Open Bug 1928177 Opened 1 month ago Updated 20 days ago

Add a thread local cache to mozjemalloc

Categories

(Core :: Memory Allocator, enhancement)

enhancement

Tracking

()

People

(Reporter: jrmuizel, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

mozjemalloc is one of the few allocators that doesn't have a thread local cache. Chrome's partitionalloc and WebKit's libpas both have one. tcmalloc and jemalloc have them and mimalloc only has thread local allocations.

In fact, it seems like it's mostly an accident of history that mozjemalloc doesn't have one as jemalloc got one shortly after the last time it was merged into mozilla-central: https://github.com/jrmuizel/jemalloc-history/commit/af1cee3b8e49dacc35719c0e8d27bfec6be89f78

This work is motivated by speedometer3 showing significant actual contention as well as a fair amount of time spent taking locks when we don't have contention.

I don't have an intuition for what design of the cache should be. We'll have to work that out.

Blocks: 1843932
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.