lua-users home
lua-l archive

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


Hum? I think the logic implied was to amortize your 'waste of time and memory', with 'I don't really care' and get a win from less effort spent over time (which often means money, or time to spend on something else)

Don't really see how least astonishment principle fits in here, that basically says 'don't do stupid stuff that can confuse people'..

Whether ignoring a time consuming optimization or not is deemed 'correct practice' or not isn't really anything to discuss here, since it will never end, but I wouldn't call recompiling 'wrong' in any way..

Alex Davies wrote:
Matthew Paul Del Buono wrote:
That being said, recompilation is only as expensive if it needs to be. Code first, profile and optimize after. I wouldn't recommend it, but recompiling is certainly a valid option if it's not too expensive for your needs.

I respectfully disagree on this note. lua_pushvalue isn't an optimization in this case, but moreso correct practice. Imo, to recompile it each time violates that least astonishment law, along with wasting time and memory.

So I believe the only-optimize-bottlenecks doesn't apply. Still, probably debateable. :)

- Alex