LuaJIT's Quad-Color Garbage Collector Idea

I’m not well-informed about Go’s future gc plans, but did the LuaJIT guy really outthink the experts behind Go?

1 Like

To me, that sounds like a loaded question : )

My opinion is that the Go development strategy avoids premature optimization. This often means using simpler, “older”, or seemingly less sophisticated technology… until a need for something else is proven.

And that “something else” tends to be extremely well thought out.

From my reading of the article, the switch from 3-color to 4-color in LuaJIT interacts with their memory layout in a way that improves cache locality. One bit of the “color” is stored inline with the object, and one bit is stored elsewhere. Using four colors makes more use of the inline “gray” bit, and less use of the black/white bit that is stored elsewhere. As near as I can figure out, the “gray” bit is stored in the “object tag”. Go doesn’t have object tags, so this optimization is unlikely to be useful in Go’s garbage collector.


Thank you.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.