lua-users home
lua-l archive

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


* Geoff Leyland:

> what's the story with the binary-trees benchmark?  Is it a GC thing,
> a recursive thing or is it a bad benchmark?

It's just a very special GC benchmark.  The heap usage pattern doesn't
follow the generational hypothesis.  There is no pointer mutation at
all.  But it's not totally unrealistic: this is what happens if you
load data structures, without producing much garbage.

I think you win if you happen to collect the heap at points where the
short-living trees are small, or not collect at all.  To some extent,
the benchmark measures per-object overhead for small objects (because
as you said, you can disable GC altogether if the total heap size is
small).

I don't think a generational collector is necessarily a win (because
the benchmark is really quite anti-generational).  I doubt that Lua
implementations can ever perform well on this benchmark because the
dual nature of Lua tables means that there are one or two unused words
per allocated table (or additional internal types, which will penalize
other benchmarks).  But perhaps using closures instead of tables can
result in competitive performance.