Closed Bug 1837192 Opened 1 year ago Closed 1 year ago

Consider caching hints for eager Ion compilation

Categories

(Core :: JavaScript Engine: JIT, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: denispal, Assigned: denispal)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

This is similar to the work done in bug 1824772 but instead of just eagerly compiling Ion the idea is to lower the threshold so we still have some iterations to collect enough profiling data, and if we invalidate too much then increase the threshold for that script.

Here are results from a prototype: https://treeherder.mozilla.org/perfherder/compare?originalProject=try&newProject=try&newRevision=7bf04cfc1666b2649c7c2b47f4afc277de66425b&framework=13&originalRevision=f85f59df353fe51ec112f36167969d39af459728&page=1

In this prototype the eager threshold is 550 and if a script is invalidated 3 times then we increase the hint threshold by 1000.

Eventually, these hint caches should go into the necko cache so it can used more effectively during page load.

Severity: -- → N/A
Priority: -- → P2

Cache a hint whenever a script is Ion compiled. The next time we encounter the same script within the same process, use an eager threshold value to accelerate into the Ion tier. If the script bailout invalidates, then increment the threshold for that script. Repeat until we reach a maximum threshold value, or the script stops invalidating.

Just a note, the purpose of JIT heuristics is to provide a mean-time to let the "novelty" settle down in order to compensate for the trade-off of a wasted compilation. A heuristic is here to ensure that the speed-up gain multiplied by the expected run-time can compensate for the compilation cost. The sooner we compile, the more likely we are to trash a compilation result sooner, and as such, the less likely the speed-up gain is to compensate for the compilation time.

What would be amazing, is if changes to heuristics were driven by the expected life-time of function since some monitored metrics. Then, we might choose a larger value than what is reported by the analysis, for memory consumption concerns, for example. Without such analysis, heuristic modification is like blind folded driving.

Pushed by dpalmeiro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ab845ce2e822
Cache Ion hints in the process r=iain
Pushed by dpalmeiro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/323cd57deb4d
Cache Ion hints in the process r=iain
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch

Improvements on AWFY:
2%-3% overall on Speedometer2

2%-3% on Sunspider

Jetstream2:
13% on mandreel-First
10% on delta-blue-First
Some improvement on lebab-wtb-Geometric, prepack-wtb-Average etc.
Unsurprisingly, looks like some sub-tests from Octane really like to get into ion as early as possible.

(In reply to Pulsebot from comment #5)

Pushed by dpalmeiro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/323cd57deb4d
Cache Ion hints in the process r=iain

== Change summary for alert #39021 (as of Fri, 14 Jul 2023 04:03:30 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new) Performance Profiles
10% google-docs LastVisualChange windows10-64-shippable-qr fission warm webrender 4,038.94 -> 3,628.42 Before/After
6% google-docs SpeedIndex windows10-64-shippable-qr fission warm webrender 1,072.16 -> 1,011.36 Before/After
5% google-docs PerceptualSpeedIndex windows10-64-shippable-qr fission warm webrender 644.45 -> 610.67 Before/After
4% google-docs ContentfulSpeedIndex windows10-64-shippable-qr fission warm webrender 780.78 -> 745.93 Before/After
4% speedometer3 windows10-64-shippable-qr fission webrender 11.96 -> 12.41 Before/After
... ... ... ... ... ...
3% pinterest fcp linux1804-64-shippable-qr fission warm webrender 305.58 -> 297.47 Before/After

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

Keywords: perf-alert

(In reply to Alex Finder from comment #8)

(In reply to Pulsebot from comment #5)

Pushed by dpalmeiro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/323cd57deb4d
Cache Ion hints in the process r=iain

== Change summary for alert #39021 (as of Fri, 14 Jul 2023 04:03:30 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new) Performance Profiles
10% google-docs LastVisualChange windows10-64-shippable-qr fission warm webrender 4,038.94 -> 3,628.42 Before/After
6% google-docs SpeedIndex windows10-64-shippable-qr fission warm webrender 1,072.16 -> 1,011.36 Before/After
5% google-docs PerceptualSpeedIndex windows10-64-shippable-qr fission warm webrender 644.45 -> 610.67 Before/After
4% google-docs ContentfulSpeedIndex windows10-64-shippable-qr fission warm webrender 780.78 -> 745.93 Before/After
4% speedometer3 windows10-64-shippable-qr fission webrender 11.96 -> 12.41 Before/After
... ... ... ... ... ...
3% pinterest fcp linux1804-64-shippable-qr fission warm webrender 305.58 -> 297.47 Before/After

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

== Change summary for alert #39027 (as of Fri, 14 Jul 2023 14:41:14 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new) Performance Profiles
4% google-docs ContentfulSpeedIndex windows10-64-shippable-qr fission warm webrender 780.78 -> 745.93 Before/After
3% nytimes LastVisualChange windows10-64-shippable-qr fission warm webrender 1,311.76 -> 1,276.21
2% nytimes SpeedIndex windows10-64-shippable-qr fission warm webrender 1,044.16 -> 1,019.46
2% speedometer3 windows10-64-nightlyasrelease-qr fission webrender 11.87 -> 12.13 Before/After

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

Flags: needinfo?(dpalmeiro)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: