Closed Bug 719189 Opened 12 years ago Closed 12 years ago

*Major* performance issue with javascript in FireFox 9

Categories

(Core :: JavaScript Engine, defect)

9 Branch
x86
All
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 706914

People

(Reporter: info, Unassigned)

References

()

Details

(Keywords: perf, regression)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7

Steps to reproduce:

Upgrading from FireFox 8.0.1 to FireFox 9.0.1, we observed a *major* performance issue processing the javascript file of our website:

http://www.mellorgroup.ca/Home

The website contains a javascript file of significant size: over 30 000 lines of code.



Actual results:

Using FireFox 8.0.1, processing the file would be instantaneous, faster than 50 milliseconds for the page to load.

Using FireFox 9.0.1, processing the file can take over 30 seconds. A window eventually shows up as the javascript file is loading to ask if the user would like to stop executing the file since it is taking to long before completing execution.

So far our investigations indicate handling of the prototypes could be causing the major slowdown, but we are not 100% conclusive.

After all prototypes have been handled, javascript execution becomes fast and the website is 100% usable. If we refresh the page, then the javascript takes another 30 seconds to load before becoming fast again.


Expected results:

We expect the processing of the javascript file to be at least as fast as FireFox 8.

FireFox 9 should process javascript 20-30% faster than FireFox 8, but instead we observe FireFox 9 is 60 times slower than FireFox 8 at processing the same javascript file.
Keywords: perf
I can reproduce on
http://hg.mozilla.org/mozilla-central/rev/f4049f65efc6
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120118 Firefox/12.0a1 ID:20120118031059
and
http://hg.mozilla.org/mozilla-central/rev/f4049f65efc6
Mozilla/5.0 (X11; Linux i686; rv:12.0a1) Gecko/20120118 Firefox/12.0a1 ID:20120118031059


WORKA\ROUND:
set javascript.options.methodjit.content to false.


Regression window(m-c)
Works fine:
http://hg.mozilla.org/mozilla-central/rev/85d9c87ef45a
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0a1) Gecko/20110829 Firefox/9.0a1 ID:20110829154046
Reproduce:
http://hg.mozilla.org/mozilla-central/rev/b61af4d7dc7c
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0a1) Gecko/20110829 Firefox/9.0a1 ID:20110829214159
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=85d9c87ef45a&tochange=b61af4d7dc7c


Regression window(jm)
Works fine:
http://hg.mozilla.org/projects/jaegermonkey/rev/3e32ddcd4bcd
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110818 Firefox/8.0a1 ID:20110818040247
Reproduce:
http://hg.mozilla.org/projects/jaegermonkey/rev/7dae91c263cf
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110819 Firefox/8.0a1 ID:20110819040253
Pushlog:
http://hg.mozilla.org/projects/jaegermonkey/pushloghtml?fromchange=3e32ddcd4bcd&tochange=7dae91c263cf

Triggered by:
7dae91c263cf	Brian Hackett — [INFER] Allow analysis/compilation of top level <script>, bug 662704.
Assignee: nobody → general
Blocks: 662704
Status: UNCONFIRMED → NEW
Component: Untriaged → JavaScript Engine
Ever confirmed: true
Keywords: regression
OS: Windows 7 → All
Product: Firefox → Core
QA Contact: untriaged → general
Hardware: x86_64 → x86
Given the blame cset, the problem here seems to be a really enormous top level script, which compilation performance in Firefox 9 is pretty bad at.  Bug 706914 should help this out a lot and just landed, so you can try out a nightly build (probably starting tomorrow) to see if things improve.  That will not be in a release version of Firefox until Firefox 12, however, so for now an alternate workaround is to add a 'with({}){}' to the top level script, which will disable compilation for the script.
Depends on: 706914
Bug 706914 helped a lot, the site is usable again.

Even http://bellard.org/jslinux/ got usable and starts a lot faster than
in Firefox 11 Aurora. :-)
Status: NEW → RESOLVED
Closed: 12 years ago
No longer depends on: 706914
Resolution: --- → DUPLICATE
(In reply to Stefan Fleiter (:sfleiter) from comment #3)
> Bug 706914 helped a lot, the site is usable again.
Thanks for checking that out!(In reply to Stefan Fleiter (:sfleiter) from comment #3)
> Bug 706914 helped a lot, the site is usable again.
> 
> Even http://bellard.org/jslinux/ got usable and starts a lot faster than
> in Firefox 11 Aurora. :-)

Thanks for checking that out!
You need to log in before you can comment on or make changes to this bug.