Closed Bug 1799628 Opened 2 years ago Closed 2 years ago

Cache the two most recent lookups in StringToAtomCache

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(1 file)

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.

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).

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/289500d6f5c8 Cache most recent lookups in StringToAtomCache. r=jonco
Severity: normal → N/A
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Blocks: 1803803
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: