Figure out what to do with ArrayJoinResult
Categories
(Core :: JavaScript Engine: JIT, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox82 | --- | fixed |
People
(Reporter: jandem, Assigned: anba)
References
Details
Attachments
(4 files)
This is a very specific optimization for join on arrays with length <= 1. I'm a bit worried about supporting this in Warp because it feels like over-specialization that could easily result in bailouts. However, if we don't transpile it, we'll use the CallGeneric call path which isn't great. Maybe we should just disable this stub if Warp is enabled...
| Reporter | ||
Comment 1•5 years ago
|
||
Another option is to call jit::ArrayJoin but that's just calling array_join anyway.
| Reporter | ||
Updated•5 years ago
|
| Assignee | ||
Comment 2•5 years ago
|
||
Bug 1382837 has some numbers to explain why we optimise for length <= 1.
Comment 3•5 years ago
|
||
It looks like this was added for Speedometer, but I don't see any perf numbers reported in bug 1382837. If we disable this stub, does it affect Speedometer performance? If it doesn't, then maybe we can just eliminate it entirely.
| Assignee | ||
Comment 4•5 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1382837#c4, https://bugzilla.mozilla.org/show_bug.cgi?id=1382837#c7, and https://bugzilla.mozilla.org/show_bug.cgi?id=1382837#c9 mention this is also useful outside of benchmarks, for example it applies to GDocs, too.
| Reporter | ||
Comment 5•5 years ago
|
||
Another option is to restrict to packed arrays and do a VM call to ArrayJoinDenseKernel, but that doesn't handle objects/symbols... Handling objects requires AutoCycleDetector and if we add that it's not clear how much faster it still is over array_join.
| Assignee | ||
Comment 6•5 years ago
|
||
What if we change the CacheIR implementation to more closely match the inline code path in CodeGenerator? I.e. handle the zero and one element case inline and for all other cases perform a VM call?
-> https://treeherder.mozilla.org/#/jobs?repo=try&revision=176a02993e373bfa6f7b8c4629b1681ea1348d83
| Reporter | ||
Comment 7•5 years ago
|
||
(In reply to André Bargull [:anba] from comment #6)
What if we change the CacheIR implementation to more closely match the inline code path in CodeGenerator? I.e. handle the zero and one element case inline and for all other cases perform a VM call?
-> https://treeherder.mozilla.org/#/jobs?repo=try&revision=176a02993e373bfa6f7b8c4629b1681ea1348d83
That looks great. Thanks!
| Assignee | ||
Comment 8•5 years ago
|
||
Change to unshared CacheIR op in preparation for part 3.
Updated•5 years ago
|
| Assignee | ||
Comment 9•5 years ago
|
||
Add a new CacheIR op to load a constant string in preparation for part 3.
Depends on D88561
| Assignee | ||
Comment 10•5 years ago
|
||
Use a CallVM instead of a FailurePath to match the Ion optimised path. This
change will allow part 4 to use the existing MArrayJoin call for Warp.
Depends on D88562
| Assignee | ||
Comment 11•5 years ago
|
||
Depends on D88564
| Reporter | ||
Comment 12•5 years ago
|
||
You read my mind :) I was just looking at some micro-benchmarks for this and, not surprisingly, --warp is indeed 6x slower than Baseline (--no-ti) on the one below.
function f() {
var arr = [];
var res = "";
var t = dateNow();
for (var i = 0; i < 10_000_000; i++) {
res = arr.join(",");
}
print(dateNow() - t);
print(res);
}
f();
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/29976a2bca84
https://hg.mozilla.org/mozilla-central/rev/fa309b2541bf
https://hg.mozilla.org/mozilla-central/rev/bab7bab23941
Comment 15•5 years ago
|
||
Just curious, but I see a patch in Lando not showing as landed yet the bug is closed. Is this intended?
| Assignee | ||
Comment 16•5 years ago
|
||
(In reply to K Carter from comment #15)
Just curious, but I see a patch in Lando not showing as landed yet the bug is closed. Is this intended?
Ah, thanks for noticing! I didn't set the "check-in needed" flag at the top of stack, so the last commit wasn't committed.
Comment 17•5 years ago
|
||
Comment 18•5 years ago
|
||
| bugherder | ||
Description
•