Bug 1920678 - Add a pool for the memory chunks used by per-frame allocators. r=gfx-reviewers,lsalzman

Instead of dropping the frame's memory chunk when a frame is replaced, place the chunks into a global pool. This mostly helps when running stress tests like motionmark's html suite that cause intense allocation spikes (around 90 chunks per frame).

We should revisit whether this is needed if the cost of deallocating large regions of memory in mozjemalloc improves in the future.

Differential Revision: https://phabricator.services.mozilla.com/D223924
This commit is contained in:
Nicolas Silva
2024-09-30 14:56:28 +00:00
parent 6c45af4c95
commit da62e076dd
11 changed files with 272 additions and 92 deletions

View File

@@ -138,7 +138,7 @@ class NewRenderer : public RendererEvent {
gfx::gfxVars::UseWebRenderScissoredCacheClears(), swgl, gl,
compositor->SurfaceOriginIsTopLeft(), progCache, shaders,
aRenderThread.ThreadPool().Raw(),
aRenderThread.ThreadPoolLP().Raw(),
aRenderThread.ThreadPoolLP().Raw(), aRenderThread.MemoryChunkPool(),
aRenderThread.GlyphRasterThread().Raw(), &WebRenderMallocSizeOf,
&WebRenderMallocEnclosingSizeOf, 0, compositor.get(),
compositor->ShouldUseNativeCompositor(),