Open Bug 1529343 Opened 5 years ago Updated 2 years ago

JavaScript algebra calculation on FireFox is slower than on Chrome

Categories

(Core :: JavaScript Engine: JIT, defect, P2)

63 Branch
defect

Tracking

()

Performance Impact low
Tracking Status
firefox67 --- affected

People

(Reporter: hogehoge, Unassigned)

Details

(Keywords: perf, perf:responsiveness)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36

Steps to reproduce:

  1. Go to Three.js matrix calculation performance benchmark test page https://rawcdn.githack.com/mrdoob/three.js/r101/test/benchmark/benchmarks.html
  2. Click "Start" next to "Update world transforms"
  3. See the Ops/Sec numbers (bigger means faster)
  4. Compare the numbers between on FireFox and on Chrome

Relevant codes:
https://github.com/mrdoob/three.js/blob/r101/test/benchmark/core/UpdateMatrixWorld.js#L9-L46
https://github.com/mrdoob/three.js/blob/r101/src/core/Object3D.js#L593-L633
https://github.com/mrdoob/three.js/blob/r101/src/math/Matrix4.js#L741-L775
https://github.com/mrdoob/three.js/blob/r101/src/math/Matrix4.js#L378-L416

Actual results:

You see that the number on FireFox is much worse than the one on Chrome. On my windows FireFox is 2-3x worse.

FireFox:
depth=100, breadth=1 (101 nodes): 44442 Ops / Sec, 4.02
depth=3, breadth=10 (1111 nodes): 4306 Ops / Sec, 3.06
depth=9, breadth=3 (29524 nodes): 117 Ops / Sec, 1.49

Chrome:

depth=100, breadth=1 (101 nodes): 122936 Ops / Sec, 4.12
depth=3, breadth=10 (1111 nodes): 11759 Ops / Sec, 3.78
depth=9, breadth=3 (29524 nodes): 149 Ops / Sec, 5.48

Expected results:

The number on FireFox should be as good as the one on Chrome.

Component: Untriaged → JavaScript Engine: JIT
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: perf
Priority: -- → P2
Whiteboard: [qf]
Whiteboard: [qf] → [qf:p3:responsiveness]

Per attachment of Comment 1 and Comment 2, we have a similar result in FxR standalone (GeckoView) vs Oculus browser (Chromium) too when running "Update world transforms".

FxR:
depth=100, breadth=1 (101 nodes): 4368 Ops / Sec, 1.18
depth=3, breadth=10 (1111 nodes): 319 Ops / Sec, 3.67
depth=9, breadth=3 (29524 nodes): 11 Ops / Sec, 2.39

Oculus Browser:
depth=100, breadth=1 (101 nodes): 37478 Ops / Sec, 0.92
depth=3, breadth=10 (1111 nodes): 2872 Ops / Sec, 2.50
depth=9, breadth=3 (29524 nodes): 43 Ops / Sec, 2.30

Iain, would you be able to investigate this issue?

Daosheng, would it be possible to have a JS shell / Browser benchmarks which reproduce the issue you are seeing?
From what I understand, what you are reporting is non-actionable from us, as this require a head-set. Do we have any harness for running these benchmarks in automated test, or even better on a local computer?

Also, are you able to bisect this regression?

Flags: needinfo?(iireland)
Flags: needinfo?(dmu)
Attached file three-js-shell.js

Shell script to run the three.js benchmark.

Browser runner can either be derived from the shell script or by directly running the web page linked in comment #0.

Thanks André!

Flags: needinfo?(dmu)

I just come back from my PTO, please let me if you need any assistance.

I am currently busy landing the regexp engine update, but I will take a look at this when I have some spare cycles.

Flags: needinfo?(iireland)
Performance Impact: --- → P3
Whiteboard: [qf:p3:responsiveness]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: