Closed Bug 1365376 Opened 5 years ago Closed 3 years ago

Firefox [javascript] 4-times slower than Chrome/Opera/Vivaldi


(Core :: JavaScript Engine, defect, P5)

53 Branch





(Reporter: colormatch, Unassigned)




(1 file)

Attached image Firefox-problem.jpg
User Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170504105526

Steps to reproduce:

I'm writing a web-app, which depends a lot on javascript, and surprisingly it turned out that only on Firefox the performance is lacking (x4 slower on v53/4, and x2.5 slower on 55-nightly).

Environment: PC Windows-8; all plugins/extensions are disabled; the latest version - 53.0.2 (64-bit); also the "developer edition" of Firefox 54.0a2 (2017-05-10) (64-bit) gave the same performance result.

you can test/confirm for yourself here: 

Actual results:

In a test, 25MP target image was rendered on the site (after pressing "download"), with Chrome/Opera/Vivaldi all renders in around 10sec, but Firefox took about 40 seconds to render.

Using the mouse-wheel to change the blending ("target image" is re-rendered with different parameters the preview image), with all other browsers happens smoothly, but with Firefox takes 0.5~1 second to re-render a frame, when the other browsers manage to smoothly animate the adjustments.

Using version 55 (nightly build):
- rendering is better, but it still takes about 25 seconds (2.5 times the rest of the browsers)
- mouse-wheel scroll (changing blending) starts promising for a few seconds, but eventually halts rendering completely after a several more seconds. (for comparison Chrome's rendering performance remains consistent) . Screenshot attached.

Expected results:

It should have been on par with the rest of the modern browsers.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Flags: needinfo?(jdemooij)
Thanks for the report!

It would help to have more precise steps-to-reproduce (click here, then click here, etc) as I don't know how your webapp works. Maybe you can attach pictures you used for testing to this bug, or upload them somewhere?
Flags: needinfo?(colormatch)

step 1) click and load (or drop) in the box for "source image" any image you like
step 2) click and load (or drop) in the box for "target image" any image you like

test 1: scroll the mouse-wheel while cursor is over the "target image", and watch in the FPS in the debugger.
Example of that is attached - comparing FPS shown in the debuggers in Firefox and Chrome performing the same action.

After you have loaded (any) 2 images, as source and target:

test 2: press "download" from the "target image" box.
Compare the performance (the time it takes to render full size) of Firefox vs Chrome/Vivaldi/Opera.

Try using larger than 20MP image, as the larger the image, the more noticeable the performance difference is. 

If you need to find a large size images for the test, you can use google. Here are some over 20MP:,isz:lt,islt:20mp&tbm=isch
Flags: needinfo?(colormatch)
I also encounter extremely slow response using Firefox to access eBay pages.
  "javascript" appears in the lower left while the page is waiting to load.
  "Unresponsive script" messages pop up all the time.
  CPU time goes to 100% for several seconds for every page update.

My system:
[ads@ADS2 ~]$ uname -a
Linux ADS2 4.11.12-200.fc25.i686 #1 SMP Fri Jul 21 17:19:28 UTC 2017 i686 i686 i386 GNU/Linux
[ads@ADS2 ~]$ 

Firefox is 54.0.1 (32 bit)

I think a good way of demonstrating the problem is to go to and search for something.
Seems like a nested-function was killing the performance (compared to Chrome).
After removing it, performance is decent.
Flags: needinfo?(jdemooij)
Priority: -- → P5
Closed: 3 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.