The default bug view has changed. See this FAQ.

Huge performance regression in Emscripten generated code

RESOLVED FIXED in Firefox 16

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Ehsan, Assigned: u443197)

Tracking

(Blocks: 1 bug, {perf, regression})

Trunk
mozilla17
perf, regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox16+ fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
The 07/13 nightly regressed the performance of Emscripten generated code by a huge amount (about 30 times slower).

The regression range is http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=46804c31366b&tochange=6489be1890c0.  I'm currently bisecting it to see what changeset is at fault.
(Reporter)

Updated

5 years ago
Blocks: 710398
tracking-firefox16: --- → +
Might be bug 765435 if you are dealing with >500MB JS heap.
(Reporter)

Comment 2

5 years ago
(In reply to Gregor Wagner [:gwagner] from comment #1)
> Might be bug 765435 if you are dealing with >500MB JS heap.

That could very well be it.  I'm half way through bisection so I don't wanna back out that single patch right now and ruin my bisection session, I'll update the bug as soon as I confirm this.
You could just set javascript.options.mem.gc_dynamic_heap_growth to false in about:config
(Reporter)

Comment 4

5 years ago
(In reply to Gregor Wagner [:gwagner] from comment #3)
> You could just set javascript.options.mem.gc_dynamic_heap_growth to false in
> about:config

That didn't help, and unfortunately hg bisect took me to a merge changeset:

$ hg bis -gThe first bad revision is:
changeset:   99101:6489be1890c0
parent:      99070:6a640ca09064
parent:      99100:1f4ad785cca8
user:        Ryan VanderMeulen <ryanvm@gmail.com>
date:        Thu Jul 12 20:46:27 2012 -0400
summary:     Merge the last PGO-green inbound changeset to m-c.

Maybe I should try bisecting in git...
Mabye it's not me :)
If it is GC related you can see it if you turn on javascript.options.mem.log and watch the Error Console for GC events.

Comment 6

5 years ago
I believe hg bisect should bisect through merges intelligently, if you start it early enough (from a shared ancestor of the merged branches) - should be the same as with git.
(Reporter)

Comment 7

5 years ago
(In reply to comment #5)
> Mabye it's not me :)
> If it is GC related you can see it if you turn on javascript.options.mem.log
> and watch the Error Console for GC events.

What would I watch for?  A lot of GCs happening?
(Reporter)

Comment 8

5 years ago
(In reply to comment #6)
> I believe hg bisect should bisect through merges intelligently, if you start it
> early enough (from a shared ancestor of the merged branches) - should be the
> same as with git.

I've already started to bisect with git.  Git should be able to handle this type of bisection fine, even if you don't use a common ancestor...
(In reply to Ehsan Akhgari [:ehsan] from comment #7)
> (In reply to comment #5)
> > Mabye it's not me :)
> > If it is GC related you can see it if you turn on javascript.options.mem.log
> > and watch the Error Console for GC events.
> 
> What would I watch for?  A lot of GCs happening?

Yes. Maybe compare the number of GCs with a nightly that doesn't show the regression.
Why not bisect on inbound?
(Reporter)

Comment 11

5 years ago
OK, found the offending changeset:

http://hg.mozilla.org/mozilla-central/rev/17bc02a42a1a

Alex, could you please take a look?

(This only happens if the Gecko Profiler add-on is turned on.)
Blocks: 772078
(Reporter)

Updated

5 years ago
Duplicate of this bug: 774438
(Assignee)

Comment 13

5 years ago
Just to be sane, the performance is normal if the profiler is turned off?
(Assignee)

Comment 14

5 years ago
Created attachment 642815 [details] [diff] [review]
patch

I ran this with the demo in bug 774438 and the fps was back up where it was without profiling enabled.

Fun fact: the interpreter is a lot slower than the JIT.
Assignee: general → acrichton
Status: NEW → ASSIGNED
Attachment #642815 - Flags: review?(luke)

Comment 15

5 years ago
Comment on attachment 642815 [details] [diff] [review]
patch

Schwoops

nit: no { } around single-line then branch
Attachment #642815 - Flags: review?(luke) → review+
(Assignee)

Comment 16

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/36fcd6eabf67
(Reporter)

Comment 17

5 years ago
Thanks Alex for the quick fix!  :-)
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → mozilla17
Version: unspecified → Trunk
If that bug went to aurora, we should get the patch on that branch as well.

Comment 19

5 years ago
Comment on attachment 642815 [details] [diff] [review]
patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 772078
User impact if declined: profiling turns of the jit entirely
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): very low: only exercised when profiling is on
Attachment #642815 - Flags: approval-mozilla-aurora?
(Reporter)

Comment 20

5 years ago
(In reply to comment #18)
> If that bug went to aurora, we should get the patch on that branch as well.

Absolutely!
https://hg.mozilla.org/mozilla-central/rev/36fcd6eabf67
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Comment on attachment 642815 [details] [diff] [review]
patch

low risk, tested fix, approving.
Attachment #642815 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Reporter)

Comment 23

5 years ago
http://hg.mozilla.org/releases/mozilla-aurora/rev/c5081fdf23e0
status-firefox16: --- → fixed
You need to log in before you can comment on or make changes to this bug.