Closed Bug 1857237 Opened 2 years ago Closed 2 years ago

Make the external string cache also work for the inline string path

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

(Keywords: perf-alert, Whiteboard: [sp3])

Attachments

(1 file)

In bug 1353758 we added a simple external string cache. After that, in bug 1038099, we added a fast path where instead of allocating an external string, we allocate a short Latin-1 string if possible, but this bypasses the cache.

The inline-Latin-1 path in NewMaybeExternalString is very effective, but we can improve it by caching those as well. On Speedometer 3 I get the following numbers for doing that:

inline hit:   324402 (90.3% of all inline lookups)
external hit:  81584 (26.4% of all external lookups)

This shows that the cache is super effective for inline strings allocated here. It gets rid of most of the allocations.

In NewMaybeExternalString we have a fast path for short Latin1 strings. This case is
very common.

Changing the cache to handle these too is very effective: the lookupInline method
has a hit rate of at least 90% on Speedometer 3.

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0dc83bc5c9cf Use the external string cache also for the inline string path. r=jonco
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch

(In reply to Pulsebot from comment #2)

Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0dc83bc5c9cf
Use the external string cache also for the inline string path. r=jonco

== Change summary for alert #39922 (as of Thu, 12 Oct 2023 05:15:09 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
14% perf_reftest_singletons id-getter-2.html windows10-64-shippable-qr e10s fission stylo webrender 749.41 -> 644.63
13% perf_reftest_singletons id-getter-2.html windows10-64-shippable-qr e10s fission stylo webrender 756.08 -> 655.20
12% perf_reftest_singletons id-getter-2.html linux1804-64-shippable-qr e10s fission stylo webrender 1,016.52 -> 889.94
7% dromaeo_dom linux1804-64-shippable-qr e10s fission stylo webrender-sw 3,343.47 -> 3,569.20

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=39922

Keywords: perf-alert
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: