Consider adding a 4th tier using Ion optimization levels
Categories
(Core :: JavaScript Engine: JIT, enhancement, P3)
Tracking
()
People
(Reporter: jandem, Assigned: jandem)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
Attachments
(8 files, 1 obsolete file)
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
Comment 1•8 years ago
|
||
Assignee | ||
Comment 2•8 years ago
|
||
Comment 3•8 years ago
|
||
Comment 4•7 years ago
|
||
Updated•7 years ago
|
Assignee | ||
Comment 5•6 years ago
•
|
||
I've been playing with this a bit and it's still a significant win on Speedometer (> 5%), Google Docs (5-10%) etc. SunSpider, Kraken, Octane are either unaffected or show an improvement.
This only tunes inlining options - we could probably get more speedups by making more IonBuilder code or expensive optimization passes run only at the highest optimization level.
Comment 6•6 years ago
|
||
Just as a thought, I have been wondering whether it would be possible to use AFL-style branch tuples (http://lcamtuf.coredump.cx/afl/technical_details.txt) in the Baseline ICs to generate an implicit trace.
If we had something like that, then we would be able to make separate trace trees by type/shape, receiving the benefits of inlining even in polymorphic code.
I believe the answer is yes, but it's quite a lot of work.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 7•6 years ago
|
||
We used to have a different threshold for small functions but now they're both
set to 1000 so there's no need to special-case small functions.
Assignee | ||
Comment 8•6 years ago
|
||
Storing this also in IonOptimizationLevels.h/cpp is more complicated than
necessary.
Depends on D24153
Assignee | ||
Comment 9•6 years ago
|
||
There's a lot of complexity around setting/unsetting the eagerCompilation flag.
It's simpler to determine this based on the warm-up threshold being 0.
The patch also fixes some jit-tests where this patch would result in a change in
behavior.
Depends on D24154
Assignee | ||
Comment 10•6 years ago
|
||
Also adds a javascript.options.ion.full.threshold browser pref and similar shell
flags.
This doesn't rename the existing prefs yet.
Depends on D24155
Assignee | ||
Comment 11•6 years ago
|
||
We want this to be more than 100 for the full-optimizations tier. Making this
relative also works better for tests that set a small Ion warm-up threshold.
Also disables OSR in some tests depending on the old behavior.
Depends on D24156
Assignee | ||
Comment 12•6 years ago
|
||
The old code would assert because we needed too many scratch registers, but it
was dead code until this patch.
Depends on D24157
Assignee | ||
Comment 13•6 years ago
|
||
Ion can do aggressive inlining, but inlining a lot of code has a negative
effect on compilation time and memory usage. It also means we spend more time
in the slower Baseline code while compiling the Ion code off-thread or after an
invalidation.
To address this, Ion now consists of two tiers:
-
Normal: the first tier (warm-up threshold of 1,000) only inlines small
functions one level deep. This tier also has recompile checks to
recompile the script when it becomes very hot. -
Full: the second tier (warm-up threshold of 100,000) is only used for very
hot code so we can afford inlining a lot more code.
This improves Speedometer and GDocs by more than 5%.
Depends on D24158
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
bugherder |
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
bugherder |
Assignee | ||
Updated•6 years ago
|
Comment 18•6 years ago
|
||
Comment 19•6 years ago
|
||
bugherder |
Assignee | ||
Comment 20•6 years ago
|
||
Unfortunately bug 1536874 made changes to the tp6 tests right before this landed, so I don't know if perf alerts will work well.
That said, I did a Try push comparing Speedometer and tp6 with and without part 7 [0] on Linux64, OS X, Win64:
- Speedometer: 5% faster
- Instagram: 20% faster on Linux64, 13% on Win64. Not sure what's going on.
- GDocs: 7-8% faster
- GSlides: 6-7% faster
- Facebook: 4% faster
- YouTube: 4% faster
And some smaller improvements across the board. Improvements might be bigger on low-end devices.
Assignee | ||
Comment 21•6 years ago
|
||
We might uplift these patches to beta. Having a JitOption makes it easier to
turn this off if needed.
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
bugherder |
Assignee | ||
Comment 24•6 years ago
|
||
Comment on attachment 9052204 [details]
Bug 1382650 part 1 - Remove separate Ion warmup threshold for small functions, as it's equivalent to the normal one. r?nbp!
Beta/Release Uplift Approval Request
- Feature/Bug causing the regression: None
- User impact if declined: After some discussion we'd like to uplift these patches to FF67 to fix issues with Ion compilation slowing down page loads.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Medium
- Why is the change risky/not risky? (and alternatives if risky): There's some risk but this has been on Nightly for a week without any issues. We think the perf improvements are worth it.
- String changes made/needed: None
Assignee | ||
Updated•6 years ago
|
Comment 25•6 years ago
•
|
||
Comment on attachment 9052204 [details]
Bug 1382650 part 1 - Remove separate Ion warmup threshold for small functions, as it's equivalent to the normal one. r?nbp!
These patches have been on Nightly for 10 days with no stability or functional regressions reported. This and the significant performance improvements on multiple major sites mean that I am taking the risk of taking these patches for 67 beta 9 as we are still in the middle of the beta cycle. If the uplifts to beta degrades our stability, we can back these patches out.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 26•6 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/7feb497c2ffe
https://hg.mozilla.org/releases/mozilla-beta/rev/02cdde2f8dbd
https://hg.mozilla.org/releases/mozilla-beta/rev/a0419e61efcd
https://hg.mozilla.org/releases/mozilla-beta/rev/9d3bcd768496
https://hg.mozilla.org/releases/mozilla-beta/rev/0e0e954b3cdc
https://hg.mozilla.org/releases/mozilla-beta/rev/e099b8601dc7
https://hg.mozilla.org/releases/mozilla-beta/rev/dfde2a76520d
https://hg.mozilla.org/releases/mozilla-beta/rev/353c9e1559f0
Comment 27•6 years ago
|
||
Backed out for spidermonkey bustages on js.cpp
Backout link: https://hg.mozilla.org/releases/mozilla-beta/rev/a330a98357513bce14a5764b8866aaf9843b9c3a
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=238661638&repo=mozilla-beta&lineNumber=2571
Updated•6 years ago
|
Comment 28•6 years ago
|
||
== Change summary for alert #20341 (as of Mon, 08 Apr 2019 08:41:03 GMT) ==
Improvements:
2% tp5o linux64-shippable opt e10s stylo 130.87 -> 127.77
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=20341
Assignee | ||
Comment 29•6 years ago
|
||
uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/2f6ee802781a28f8e41c905da2d0f5d7ca3e1380
https://hg.mozilla.org/releases/mozilla-beta/rev/2e6bccd461f45dc46e328e2ad0254df2faa20736
https://hg.mozilla.org/releases/mozilla-beta/rev/7d87558da81f21659d5ba11df5564142f88e4703
https://hg.mozilla.org/releases/mozilla-beta/rev/d4a898d579ec1f10696774f3678ad97db02b0ae4
https://hg.mozilla.org/releases/mozilla-beta/rev/adcc63bfb4dc36fc8b2ff3571430ef18a78f7ff2
https://hg.mozilla.org/releases/mozilla-beta/rev/e896facf3e28c0389d3941d1947181afba0fd49d
https://hg.mozilla.org/releases/mozilla-beta/rev/2782ec026e7956b640b250e0cacb43c7f72e0a7a
https://hg.mozilla.org/releases/mozilla-beta/rev/b6fdd2540f52de0279a2bd14e7e52736530c987b
Comment 30•6 years ago
|
||
Noticed some perf improvements! \0/
== Change summary for alert #20188 (as of Thu, 28 Mar 2019 21:31:19 GMT) ==
Improvements:
4% tp5o windows10-64-shippable-qr opt e10s stylo 122.10 -> 117.15
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=20188
Comment 31•6 years ago
|
||
== Change summary for alert #20401 (as of Thu, 11 Apr 2019 05:40:11 GMT) ==
Improvements:
5% raptor-speedometer-firefox osx-10-10 opt 39.67 -> 41.84
2% raptor-speedometer-fennec android-hw-p2-8-0-arm7-api-16-nightly opt 23.98 -> 24.53
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=20401
Description
•