Closed
Bug 470143
Opened 16 years ago
Closed 9 years ago
IM: "typeof nosuchvar" slower than in baseline, and *much* slower than in v8
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: jruderman, Unassigned)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Keywords: perf, testcase)
Attachments
(2 files)
(deleted),
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
shu
:
review+
|
Details | Diff | Splinter Review |
12% slower with -j:
for (i = 0; i < 500000; ++i) { typeof nosuchvar; }
TRACEMONKEY=verbose says:
abort: 4991: failed to find property
Abort recording (line 1, pc 11): JSOP_NAME.
I believe that using "typeof" to test for the existence of a variable is fairly common, so this is likely to affect real-world scripts.
Comment 1•14 years ago
|
||
Not fixed yet and JM is barely faster than interpreter here:
v8: 13 ms
-m: 183 ms
interp: 188 ms
-j: 222 ms
This affects peacekeeper. The ripple tests use typeof and if I switch it out with an equivalent limit check (and comment out the canvas render function), it almost doubles the speed (27 fps to 51 fps). Their typeof code is:
if (typeof(this.data[x]) != "undefined" && typeof(this.data[x][y]) != "undefined")
This is on Windows XP
Comment 4•13 years ago
|
||
Current JS shell numbers:
Interp: 194.542 ms
-j: 221.246 ms
-m: 177.820 ms
-m -n: 190.815 ms
Looks like this is still an issue in the JM+TI world.
Blocks: 467263
Summary: TM: "typeof nosuchvar" 12% slower → JM+TI: "typeof nosuchvar" barely faster than interp
Comment 5•13 years ago
|
||
Also, d8 runs this in 18ms.
Comment 6•11 years ago
|
||
Current JS shell numbers:
Interp: 174 ms
Baseline: 86 ms
IM: 94 ms
d8: 3 ms
So we're finally faster with our jit than without. Yay, I guess. Except our optimizing jit is slower than our baseline jit. Oh, and more than 30x slower than v8. Boo, I guess.
OS: Mac OS X → All
Hardware: x86 → All
Summary: JM+TI: "typeof nosuchvar" barely faster than interp → IM: "typeof nosuchvar" slower than in baseline, and *much* slower than in v8
Comment 7•11 years ago
|
||
FWIW, IONFLAGS=aborts complains about "Unsupported opcode: popv", which prevents Ion compilation.
Comment 8•11 years ago
|
||
Jandem, you worked on making other uses of typeof fast (e.g. bug 606648). Do you think there's something useful we can do here?
The numbers haven't really changed much: 77ms vs. 4ms in v8.
Component: JavaScript Engine → JavaScript Engine: JIT
Flags: needinfo?(jdemooij)
Comment 9•11 years ago
|
||
So from the pov of the JIT, we're just doing a GetNameCache.
A profiler says that js::jit::NameIC::update is taking almost all the time, most of it calling js::LookupName. Looks like NameIC just has no missing-property version; there's a IsCacheableNameReadSlot and a IsCacheableNameCallGetter but nothing like the IsCacheableNoProperty case we have for getprop.
Comment 10•11 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #9)
> A profiler says that js::jit::NameIC::update is taking almost all the time,
> most of it calling js::LookupName. Looks like NameIC just has no
> missing-property version; there's a IsCacheableNameReadSlot and a
> IsCacheableNameCallGetter but nothing like the IsCacheableNoProperty case we
> have for getprop.
Yup that would help. If cache.isTypeOf(), attach a stub that guards on the shapes on the scope chain and then returns undefined.
Flags: needinfo?(jdemooij)
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
Comment 11•9 years ago
|
||
Attachment #8698643 -
Flags: review?(jdemooij)
Comment 12•9 years ago
|
||
Attachment #8698645 -
Flags: review?(shu)
Comment 13•9 years ago
|
||
Comment on attachment 8698645 [details] [diff] [review]
Part 2 - TrackedOptimizations update for new IC type.
Review of attachment 8698645 [details] [diff] [review]:
-----------------------------------------------------------------
Thank you.
Attachment #8698645 -
Flags: review?(shu) → review+
Comment 14•9 years ago
|
||
Comment on attachment 8698643 [details] [diff] [review]
Part 1 - Implement TypeOfNoSuchVar Ion IC.
Review of attachment 8698643 [details] [diff] [review]:
-----------------------------------------------------------------
Sorry for the delay. Great patch, thanks for fixing this old bug!
Attachment #8698643 -
Flags: review?(jdemooij) → review+
Comment 15•9 years ago
|
||
Comment 16•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/989883d9a10a
https://hg.mozilla.org/mozilla-central/rev/8554cdd93607
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•