Use a free list for EMBSTR objects creation / release.
To my surprise, mantaining a small poll of objects provides a very big speedup even when the jemalloc allocator is used, which is supposed to have arenas doing mostly the same work. Probably this is a combination of different factors: 1) No need to manage zmalloc total memory used. 2) No locking of any kind because we can assume single thread, so maintaining the free list may be cheaper for us compared to jemalloc. 3) More locality because of a different cache/reuse pattern?
Please register or sign in to comment