Cache the two most recent lookups in StringToAtomCache
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox108 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
js::AtomizeString
is pretty hot. Caching the two most recent lookups in its StringToAtomCache
is quite effective: it hits for > 60% of the lookups on Speedometer 2 and I see numbers ranging from 30-65% on other benchmarks and websites as well.
If this cache doesn't hit, it's just two pointer comparisons which should be negligible compared to the hash table lookup(s) we do in that case.
Assignee | ||
Comment 1•2 years ago
|
||
js::AtomizeString
is pretty hot and caching the most recent lookups helps avoid
slower hash table lookups in 30-65% of cases (> 60% on Speedometer 2).
Updated•2 years ago
|
Comment 3•2 years ago
|
||
bugherder |
Comment 4•2 years ago
|
||
FYI, nsAtom uses MruCache
https://searchfox.org/mozilla-central/rev/57527d50ef5d3df412caa5d99536f0709399be6f/xpcom/ds/MruCache.h#37-39,65
, well, at least on the main thread
https://searchfox.org/mozilla-central/rev/57527d50ef5d3df412caa5d99536f0709399be6f/xpcom/ds/nsAtomTable.cpp#178
Updated•2 years ago
|
Updated•2 years ago
|
Description
•