[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Poor man's benchmarking issue - help needed
- From: HyperHacker <hyperhacker@...>
- Date: Wed, 31 Aug 2011 03:44:04 -0600
On Wed, Aug 31, 2011 at 03:35, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Wed, Aug 31, 2011 at 11:32 AM, TNHarris <telliamed@whoopdedo.org> wrote:
>> Partly because you're measuring table lookups. Alias math.floor and math.ceil to locals and the times I get go from 40% slower to just 25% slower.
>
> That's the kind of thing that experienced people know and everyone
> else needs to know, i.e. should go in the uFAQ under optimization
> tips.
>
> steve d.
>
>
Does math.ceil(x) in a loop seriously look up 'ceil' (and maybe even
'math') every time it's called? It's not smart enough to optimize that
lookup out of a tight loop if nothing is changing it?
--
Sent from my toaster.