|
On Tue, Mar 22, 2011 at 04:06, Tim Menzies <tim@menzies.us> wrote:Slowest object creation time, fastest call speed, AFAIR — with plain Lua.
> sorry if this is an FAQ but looking at
> http://lua-users.org/wiki/ObjectBenchmarkTests, it seems that:
> 1) the standard ways of doing OO in Lua has a large overhead.
> 2) best way seems to the "closure method"
Premature optimization.
> anyone got a comment on that?
> does not matter how the OO stuff is done?
> and when folks optimize a slow Lua script, is the *first* thing that
> they look at is the class system and change that? or...?
In my practice I can't remember a case when OO stuff was a bottleneck
in Lua code — in whole system. You find something to be slow — by
doing actual profiling! — you optimize it. Sometimes — rarely — you
may have to optimize out OO — but in one specific place, not
throughout whole program.
Think about code readability and about getting things done.
Performance is secondary to that, most of the time.
Alexander.