lua-users home
lua-l archive

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


> What may be useful (or at least interesting) is for people to enable
> profiling and run real-world Lua programs.  Then, take the topmost
> functions (say, those that account for 80% of the program's 
> execution time)
> and post them here in this mailing list.  Such a list would likely show a
> handful of functions that dominate most of a Lua's program's 
> execution, and
> these would be the first candidates for optimization.

I remember seeing luaM_growaux (If I recall correctly) being far
first place in a profiler, for a program that was using very extensively
lua_getglobal, lua_gettable, etc.
This might or might not be a representative program however :)
As you say, it's something about memory management, and not VM.
In my project, I've seen the VM as one of the parts of Lua that score
high in the profiler though, but nowhere near the real bottlenecks,
since I haven't put many Lua agents in my project yet.
But maybe some speedup would be gained just by reordering functions
in source files to allow the compiler to inline them, and making
some of the debug checks inside #ifdef DEBUG/#endif tags.
Inlining can make a huge difference for some code.

-- 
Lyrian