Closed Bug 1810299 Opened 2 years ago Closed 2 years ago

JS demo (https://www.fxhash.xyz/generative/slug/ascii-dun-gen ) is a lot slower in Nightly compared with Chrome

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: mayankleoboy1, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Go to https://www.fxhash.xyz/generative/slug/ascii-dun-gen
Click on the "Open" button. This will open the demo in a new tab
Change the Map size to 200
Ensure that the type of map is "Dungeon" (in the first drop down menu)
Click on generate

Nightly: https://share.firefox.dev/3iE6hnr
Chrome: https://share.firefox.dev/3W9vVOz

Here is a profile with dungeon size as 500 : https://share.firefox.dev/3CNeXyG

This is spending a lot of time under Ion's LessThan IC's slow path. My best guess is they're doing something weird, for example one side is undefined, but I'll take a look. It might be easy to support in CacheIR.

Flags: needinfo?(jdemooij)

I can upload some patches from last year which add support for Number/Int32/Boolean against Null/Undefined relational comparison. I've initially created them for IC failures in JetStream, but I didn't observe much real-world usage, so I never uploaded them for review:

I added some logging to IonCompareIC::update and I only see hits for undefined < undefined... Do your patches handle that case too? JS code doing this is pretty broken, but if we can easily support this in the CacheIR generator it might not be too bad.

Flags: needinfo?(jdemooij) → needinfo?(andrebargull)

No, Undefined x Undefined isn't supported by my patches, but it shouldn't be too hard to support it, too.

It's actually supported.

Flags: needinfo?(andrebargull)
Severity: -- → S3
Priority: -- → P3

Move the functions in preparation for part two.

Assignee: nobody → andrebargull
Status: NEW → ASSIGNED

Instead emit a normal CompareDoubleResult instruction and for hot code let
GVN optimise the instruction to a constant.

Depends on D167132

Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/a889cd33c920 Part 1: Move EmitGuardTo functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/098909b3b7ae Part 2: Handle more relational comparison for Number/Int32/Boolean against Null/Undefined. r=jandem https://hg.mozilla.org/integration/autoland/rev/869a971a4902 Part 3: Remove extra CacheIR code for relational comparison of Number x Undefined. r=jandem
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch

Profile from latest Nightly: https://share.firefox.dev/3wd3QLV
In my highly scientific testing of 2 samples, Nightly is comparable to Chrome now.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: