Calling another compartment's Array constructor is too slow.
Categories
(Core :: JavaScript Engine: JIT, defect, P3)
Tracking
()
People
(Reporter: daniel, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
523 bytes,
text/html
|
Details |
Comment 1•9 years ago
|
||
Updated•9 years ago
|
Comment 2•9 years ago
|
||
Comment 3•9 years ago
|
||
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
Comment 7•9 years ago
|
||
Comment 8•9 years ago
|
||
Comment 10•9 years ago
|
||
Updated•8 years ago
|
Updated•6 years ago
|
Comment 11•6 years ago
|
||
OK, so with the CCW overhead eliminated, this is about 6x faster, but still much slower than creating an Array from the same global.
I created profiles for the Array case (https://perfht.ml/2SBI9DW) and the SubArray case (https://perfht.ml/2Sx4sKD) using the testcase in comment 5. The latter shows we're calling js::ArrayConstructor and then doing a bunch of work with ObjectGroup, etc, etc. The former shows us calling js::jit::NewArrayWithGroup directly from jitcode.
Presumably there's some same-realm assumption baked in there (e.g. we'd need to change Realm to call NewArrayWithGroup from jitcode in the SubArray case). Worth a separate bug blocking this one?
Comment 12•6 years ago
|
||
(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #11)
OK, so with the CCW overhead eliminated, this is about 6x faster, but still much slower than creating an Array from the same global.
I filed bug 1527822.
Comment 14•6 years ago
|
||
We should at least fix bug 1527822 and then remeasure. And decide whether we care at all about the remaining cross-compartment case.
Comment 15•6 years ago
|
||
Ah, I missed the other bug - sorry about that.
Comment 16•6 years ago
|
||
Now I get:
Browser | Time |
---|---|
Firefox 65 | 513 |
Safari | 57 |
Chrome | 21 |
Nightly | 19 |
Without the myArray[0] = 1
:
Browser | Time |
---|---|
Firefox 65 | 427 |
Safari | 32 |
Chrome | 20 |
Nightly | 2 |
(Yes we're likely optimizing away the unused allocation.)
Updated•6 years ago
|
Description
•