[Date Prev][Date Next][Thread Prev][Thread Next]
- 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 <email@example.com> wrote:
> On Wed, Aug 31, 2011 at 11:32 AM, TNHarris <firstname.lastname@example.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
> 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.