Investigate if MruCache would be useful for atom cache
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: smaug, Assigned: smaug)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [sp3])
Attachments
(1 file)
https://bugzilla.mozilla.org/show_bug.cgi?id=1799628#c4
Gecko side uses MruCache in couple of places on top of a hashtable to avoid slow hashtable accesses. It might be useful on Spidermonkey side too?
MruCache lives currently in xpcom/ds but could be of course moved to some better place if needed. And it is a very simple class, so for testing one can just copy it to wherever.
Comment 1•2 years ago
|
||
The cache is now also used from JIT code (bug 1807159). If we can improve the hit rate without bloating JIT code too much, this might be worth investigating. In local testing back then I saw the hit rate drop off fairly quickly for sizes >= 2 though.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
It is that the current cache is for exact JSLinearStrings. The cache that is used in Gecko is to avoid slow hashtable lookups.
I was playing around with this a bit and the wip patch (just copy-paste MRUCache for now to JS) that I'm about to upload reduces hashtable lookups about 33% when running sp2 react-todo.
Assignee | ||
Comment 3•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 6•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Updated•2 years ago
|
Description
•