jcrist · GitHub

@jcrist

This adds a freelist for "small" struct objects (currently defined as
`1 <= nfields <= 10`). Structs are added to the freelist during
deallocation, up to a per-size cap (currently 2000). Structs can then be
allocated from the freelist (if non-empty), skipping the cost of a
malloc.
To prevent keeping old pages around, the freelist is cleared every major
GC collection. This is done by a hook added to the module `m_traverse`
(since modules should persist for the lifetime of the program, they'll
usually be in the largest generation).
During high load, this leads to a measurable (4-6%) performance
improvement on deserialization.

Read the original on github.com ↗