IonMonkey: Multiple Emscripten-compiled projects regressed by bug 774253

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: nemo, Assigned: bhackett)

Tracking

(Depends on: 1 bug, Blocks: 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Chrome does stutter quite a bit, it must be noted, which offers a bit worse a gameplay experience.

Load the URL.  Wait for the initial data fetch, then click on the first game button.
Once the game starts, observe the fps in the upper right corner.

Well, actually, in the case of IonMonkey you don't need to pay too much attention to the FPS since the game is essentially non-functional.

Game is a cross-compile using emscripten.

Comment 1

5 years ago
I see this too (32-bit linux). 1fps in latest ionmonkey nightly, 15fps in regular nightly.
OS: Linux → All
Hardware: x86_64 → All

Updated

5 years ago
Blocks: 710398

Updated

5 years ago
Assignee: general → jdemooij
Status: NEW → ASSIGNED

Updated

5 years ago
Depends on: 785974

Updated

5 years ago
Depends on: 785986
The main problem is that we are JM-compiling the same script lots of times, filed bug 785986 to avoid this.

There are also many JM stub calls for "x >>> 0" when the result does not fit in an int32. Ion currently takes a bailout but should just handle this inline without any stub calls (bug 785974 and bug 750947).

Comment 3

5 years ago
I bisected this. It regressed due to bug 774253, specifically

changeset:   104950:01854460aa68
user:        Brian Hackett <bhackett1024@gmail.com>
date:        Sat Aug 25 06:29:43 2012 -0600
summary:     Tweak condition for triggering Ion compilation from JM, bug 774253. r=dvander

https://hg.mozilla.org/projects/ionmonkey/rev/01854460aa68

That changeset also regressed two other Emscripten-compiled projects, OpenTTD (http://play-ttd.com/ , stalls before getting to load screen, was about to file a bug) and BananaBread (bug 786026, which I will now dupe on this one).
Blocks: 774253

Comment 4

5 years ago
Further testing shows that another compiled project, Me & My Shadow (http://syntensity.com/static/mams/mams.html , stalls during LZMA decompression in worker) was also regressed by that changeset.

Updated

5 years ago
Duplicate of this bug: 786026

Updated

5 years ago
Summary: IonMonkey runs emscripten compiled game at 1-2fps (FF nightly: 35-55 fps, chromium stable: 60-80fps) → IonMonkey: Multiple Emscripten-compiled projects regressed by bug 774253
(Assignee)

Comment 6

5 years ago
Created attachment 655830 [details] [diff] [review]
bandaid

The real fix for this is bug 785986, but in the meantime this patch avoids repeatedly recompiling / discarding code for the same script in JM by not inserting Ion compilation checks if the script has already been compiled for Ion, as will happen if script->ion->bailoutExpected().
Assignee: jdemooij → bhackett1024
Attachment #655830 - Flags: review?(dvander)
Attachment #655830 - Flags: review?(dvander) → review+
(Assignee)

Comment 7

5 years ago
I haven't checked this against any of the Emscripten projects, but in the shell this fixes pdf.js in the octane benchmark which was suffering from the same problem Jan identified in comment 2.  So I assume this is the same issue, but let me know if performance is still broken anywhere.

https://hg.mozilla.org/projects/ionmonkey/rev/91493e20a6e5

Comment 8

5 years ago
I built with the patch, and checked all the emscripten projects. Everything looks great!
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.