lua-users home
lua-l archive

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


Mark Hamburg wrote:
On Jan 15, 2010, at 3:45 AM, 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?

The object benchmarks (and mine which were quite similar) are measuring dispatch and access to object state. What they aren't measuring is the cost of creating and collecting the objects.

The total cost of creating and collecting objects depends
also on their lifetime. If it is (relatively) long and
access is (relatively) fast it does not matter that much.
That in turn may lead to different decisions.

Thanks you both for clarifying.

Peter