[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Poor man's benchmarking issue - help needed
- From: Alexander Gladysh <agladysh@...>
- Date: Wed, 31 Aug 2011 14:33:50 +0400
On Wed, Aug 31, 2011 at 13:44, HyperHacker <email@example.com> wrote:
> On Wed, Aug 31, 2011 at 03:35, steve donovan <firstname.lastname@example.org> wrote:
>> On Wed, Aug 31, 2011 at 11:32 AM, TNHarris <email@example.com> 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
> 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?
Of course not! That what LuaJIT2 is for! :-)
Plain Lua does not do (almost) any optimizations.