Open Bug 1526288 Opened 6 years ago Updated 1 month ago

sin() extremely slow

Categories

(Core :: JavaScript Engine, defect, P3)

65 Branch
x86_64
All
defect

Tracking

()

People

(Reporter: linuxcbon, Unassigned)

References

Details

(Keywords: perf)

Attachments

(1 file)

Attached file sunspider-3d-morph.txt

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

Run http://dromaeo.com/?sunspider in seamonkey then in firefox separetly
and compare the results for 3D Mesh Transformation
(Transforming the points of a matrix. No visual output.)

source code for js http://dromaeo.com/tests/sunspider-3d-morph.html

Actual results:

Seamonkey 2.49.4 (64 bits)
3D Mesh Transformation: 1457.40runs/s

Firefox 65.0 (64 bits)
3D Mesh Transformation: 234.09runs/s

Expected results:

Firefox must faster for 3D Mesh Transformation

Severity: normal → major
Component: Untriaged → JavaScript Engine
OS: Unspecified → Linux
Priority: -- → P1
Product: Firefox → Core
Hardware: Unspecified → x86_64
Priority: P1 → --

It regressed in 62 cycle in m-c.

Good build: approx. 1400runs/s
Bad build: approx. 700runs/s

Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=13efb4f58614a7bb20ca3149b0ca50cf92c7a13d&tochange=c980318f4f82e2175a1f23c6c4d301f01dbd4ed1

Triggered by: Bug 1469044

Blocks: 1469044
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All

When we removed the MathCache we were aware there was a potential for regressions (and in fact, testing on Perfherder at the time highlighted a 27% degradation on Sunspider's 3d-morph in the shell.

It would be nice to try to get some of this performance back at some point, but I'm labelling P3 as I don't think this is a high priority as Sunspider doesn't reflect real web performance these days, and it's definitely not sufficient to warrant bringing back the MathCache.

Severity: major → normal
Priority: -- → P3

PS: Thanks for the bisection Alice0775

I disagree with Matthew Gaudet .

Seamonkey 2.49.4 (64 bits) 3D Mesh Transformation: 1457.40runs/s
Firefox 65.0 (64 bits) 3D Mesh Transformation: 234.09runs/s

It's not a 27% degradation, but much more.
So something is wrong and should be investigated.

One quick question: What kind of hardware are you using? You're right that the degradation you report is is more severe than anything Alice0075 or I have seen.

I just checked SeaMonkey on OS/X, Firefox 52, and Yesterday's nightly.

Seamonkey: 4972.00runs/s
Firefox 52: 5076.20runs/s
Firefox 67 (20190315215543): 2486.93runs/s

Unfortunately my attempts to run the same experiment on Linux were unsuccessful; Builds of 52 just tab-crash immediately in my VM.

Having said that, a copy of 67 in my VM is also seeing only 2000 runs / s -- slower than the same build on OS/X. It is possible the impact of the Math cache is exacerbated by a slow GLIBC implementation of one of the trigonometric functions we cached.

If the hardware you're using isn't optimized by glibc, we could see a degradation of the scale you're talking about.

I stand by my prioritization however: This code purely tests the performance of sin(); while there may be some websites where this is a bottle neck, I suspect they're few and far between and given limited engineering resources, it's not going to bubble to the top of our list any time soon.

Oh.....that's normal that you don't see the performance problems, it's because your CPU is fast , so very few performance problems appear.
I use a slow dualcore AMD Athlon for testing , so I can detect the performance problems easily

Coming to this bug here : yes sin() is very slow, but you hardly notice it if you use a fast CPU.
Many people still use slow CPUs so this SINUS COSINUS TANGENT bug really affects a lot of people.

Keywords: perf
Summary: 3D Mesh Transformation extremely slow in Firefox → sin() extremely slow
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: