lua-users home
lua-l archive

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




2015-05-16 10:32 GMT+08:00 Tim Hill <drtimhill@gmail.com>:

What are your issues with the Lua GC?
1. I hope the Lua GC-related data structure can be more cache-friendly, array/stack-based
    instead of singlle-linklist-based structure could be used for it. But I'm afraid this implementation
    may be OS-related and conflit with the goal of Lua as an embedded language.
2. I hope Lua have a incremental generational compact/move GC. I know there's one experimental
    generational GC in Lua 5.2, but it is not better than the wonderful incremental one. In our
    application the full GC was triggered very often, so we switched back to incremental GC eventually.

Some guys assert that Lua is not suitable for move GC because of the Lua/C API, I'm not very
sure about this. Yes, the return value of lua_tostring may be changed during GC, but we can fix
it in memory, or change some part of the API. Anyway the API is not always stable between Lua vesions.

Lua's current GC implementation is suitable for many situations, but for our server usage, we
hope it can be more efficient. I write one reference counting version of Lua5.1[1], sometimes
it is more efficient than the vanilla Lua.

[1] https://github.com/zenkj/luarc-5.1

Regards,
Zenk Ju