Closed Bug 841956 Opened 11 years ago Closed 11 years ago

javascript performance regression since Firefox 17.0

Categories

(Core :: JavaScript Engine, defect)

17 Branch
x86
All
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox21 - ---

People

(Reporter: cers, Unassigned)

References

()

Details

(Keywords: perf, regression, testcase, Whiteboard: [js:p2])

+++ This bug was initially created as a clone of Bug #604905 +++

I was revisiting an old library I wrote in 2010 for image analysis, and found that Firefox nightly performs about a factor 3 times slower than Firefox 4b6.

The reason I chose FF4b6 to compare to can be seen in bug 604905.

On my windows machine I get these results on jsperf:
(Operations/second)     distance   distance 2
Firefox 21 (nightly) :  5          6
Firefox 4b6          :  18         22
Chromium 26          :  11         11
I did some additional testing, and I got the results:
(Operations/second)     distance   distance 2
Firefox 21 (nightly) :  5          6
Firefox 4b6          :  18         22
Chromium 26          :  11         11
---
Firefox 12              27         28
Firefox 15              28         28
Firefox 16              28         29
Firefox 17              7          8

So it seems the regression was introduced in Firefox 17.
Looks like this script somehow manages to run its innermost functions under JM, not ion, and to get things out of typed arrays via the GetElem stubcall (at which point it's just all bad).  Also set via SetElem, but presumably there are a lot more gets than sets.

I wonder why we fail to specialize the typed array bits in JM there.
Regression window(m-c)
Good:
http://hg.mozilla.org/mozilla-central/rev/5650196a8c7d
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120822221747
Bad:
http://hg.mozilla.org/mozilla-central/rev/198ca6edd0ae
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120823033646
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=5650196a8c7d&tochange=198ca6edd0ae

Regression window(cached m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/c29869656f46
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120822104646
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/bf07c6253287
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120822112946
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=c29869656f46&tochange=bf07c6253287
Presumably bug 778724, then.
Keywords: testcase
Summary: javascript performance regression since ff4b6 → javascript performance regression since Firefox 17.0
Version: unspecified → 17 Branch
Furthermore, there are two more regression.
2nd Regression
         distance   distance2
Good       5.9          6.6
Bad        4.0          4.4

3rd Regression
         distance   distance2
Good       4.2          4.6
Bad        3.5          3.8

2nd Regression window(m-c)
Good:
http://hg.mozilla.org/mozilla-central/rev/a4ea3c56646b
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120930121518
Bad:
http://hg.mozilla.org/mozilla-central/rev/31ae286fff78
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120930175918
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=a4ea3c56646b&tochange=31ae286fff78

2nd Regression window(cached m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/a9c4d0c92df1
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120930094617
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/738c9ad0f809
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/18.0 Firefox/18.0 ID:20120930122018
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=a9c4d0c92df1&tochange=738c9ad0f809




3rd Regression window(m-c)
Good:
http://hg.mozilla.org/mozilla-central/rev/f18b12139151
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20130126 Firefox/21.0 ID:20130126034407
Bad:
http://hg.mozilla.org/mozilla-central/rev/d802d6faa080
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20130126 Firefox/21.0 ID:20130126161407
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=f18b12139151&tochange=d802d6faa080

3rd Regression window(cached m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/de3a78d90afa
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20130124 Firefox/21.0 ID:20130124182437
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/418c2f404d74
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20130124 Firefox/21.0 ID:20130124194635
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=de3a78d90afa&tochange=418c2f404d74
Blocks: 786126, 834242
Requesting tracking21 for that third regression...
It's not clear how we would track the third regression - does that mean a follow up fix to bug 778724 landed in 21 and we need to deal with that?
The third regression was from bug 834242.  Maybe we should have separate bugs on the three regressions...
We have no way of evaluating this image library's distance/distance2 as a benchmark for JS. Dave - can you re-nominate if you think this is worthwhile to investigate in the FF21 timeframe? I don't know how applicable these tests are.
Flags: needinfo?(dmandelin)
(In reply to Alex Keybl [:akeybl] from comment #9)
> We have no way of evaluating this image library's distance/distance2 as a
> benchmark for JS. Dave - can you re-nominate if you think this is worthwhile
> to investigate in the FF21 timeframe? I don't know how applicable these
> tests are.

This type of bug generally hasn't been a problem in terms of product releases. These performance faults are usually pretty specific to the page. It's worth following up at some point; I've put it into the "future perf bugs" bucket.
Blocks: WebJSPerf
Flags: needinfo?(dmandelin)
Keywords: perf
Whiteboard: [js:p2]
Firefox 23     :  6 /  6 ops/s
Latest Nightly : 37 / 41 ops/s
Chrome 31      : 10 / 10 ops/s
Safari 6.0     : 16 / 17 ops/s

Looks like Ion try-catch compilation (bug 866888, bug 909389) fixed this. I ran the second test in the shell, with/without Ion try-catch support:

js try/catch enabled  :  42 ms
d8                    :  70 ms
js try/catch disabled : 183 ms
Status: NEW → RESOLVED
Closed: 11 years ago
Depends on: 866888
Resolution: --- → FIXED
Resolution: FIXED → WORKSFORME
You need to log in before you can comment on or make changes to this bug.