lua-users home
lua-l archive

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

Peter Sommerfeld wrote:
> I'm not sure I understand the benchmark and the numbers correctly.
> Does it mean that there is no reason to avoid costly patterns
> like objects using closures (PiL 16.4) and others anymore?

Basically yes. But I should note that it's easier for the compiler
to optimize access to tables holding instances than to closures.

The one thing you need to watch out for right now is that it's not
a good idea to create lots of closures for the same prototype and
call different ones from the same inner loops. The JIT compiler
specializes to each individual closure and not the prototype and
it's hard to teach it to back off on specialization.