lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Geoff Leyland once stated:
> On 11/04/2014, at 11:57 am, Sean Conner <sean@conman.org> wrote:
> 
> >  Thanks.  Wow.  Okay.  That is quite significant.  
> > 
> >  I also like that you profiled before changing the code.  
> 
> Yeah, well... “luajit -jp” is a sampling profiler, not an exact profiler
> like luatrace [1], so it gives time spent but not execution counts.  So I
> failed to notice that the real problem was that things were getting called
> far more often than they really should have been.

  Don't be so dismissive of sampling profilers.  I can see a scenario where
one Lua function has a low execution count but takes more time than another
Lua function that has a higher execution count [2].  

  -spc (Measure twice, cut once, realize you used the wrong units ... )

> [1] https://github.com/geoffleyland/luatrace (I wrote it).  Unfortunately
> it's slooooow and doesn’t work in JITted code.

[2]	Lua function 1 calls a C function that sucks up CPU time, for
	example.  Then again, I'm talking about the Lua interpreter, not
	necessarily LuaJIT.