lua-users home
lua-l archive

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


On Mon, Sep 13, 2004 at 06:05:15PM -0700, Mark Hamburg wrote:
> >> Have any performance tests ever been done on storing string data and
> >> userdata in separate memory blocks from the headers? The benefit of doing so
> >> would be faster GC time since pointer-free memory wouldn't need to be
> >> accessed.
> > 
> > Are you sure? Unlike something like the Boehm collector, Lua never
> > needs to scan through raw data to find pointers; it knows where they
> > all are.
> 
> The GC would avoid cache loads, TLB misses, and page faults to bring in data
> without pointers because the relevant data for the GC would be more compact.

Yes, but at the expense of extra misses (as well as the dereferences
themselves) when you come to read the data. I suppose it might be
faster if the data was marked much more often than it was read, but
the generational GC in 5.1 probably helps a lot there.

-- Jamie Webb