Closed Bug 1844359 Opened 2 years ago Closed 2 years ago

Elude the memory arena lookup lock for main thread only arenas.

Categories

(Core :: Memory Allocator, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(1 file)

mozjemalloc now supports main thread only arenas which avoids locking the arena itself. But looking up this arena involves taking a lock. We can avoid that by putting these arenas into a separate structure.

I have a patch started for this, here's the result:

https://treeherder.mozilla.org/perfherder/compare?originalProject=try&originalRevision=38056748f95bc8e08a9ea438c3b42d75fd84db74&newProject=try&newRevision=5a75c05ba02e98eab3e55fceecce3bec9d1187a4&framework=13&page=1

It's not statistically significant (the confidence for all the tests & sub-tests is low) but I don't see a drawback. And when I profile it I see the proportion of time spent in GetById is reduced - so long as nothing else is increased due to some other effect.

Good!

The difference is certainly noticeable in the focused profiles.

Before: https://share.firefox.dev/3Q71aKK
After: https://share.firefox.dev/3OiQk2W

This is evidence enough that this is worth doing. Not every improvement has to be justified by statistically significant benchmark results.

Great! that was my thought also but it's nice to confirm. Okay I'll tidy up the patch.

Whiteboard: [sp3]
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8b494378f504 Lookup main thread only arenas without a lock r=glandium
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: