Open Bug 1188962 Opened 9 years ago Updated 2 years ago

Investigate Edge advantage on Unity-Particles benchmark

Categories

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

defect

Tracking

()

People

(Reporter: azakai, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: perf)

Attachments

(1 file)

A windows site benchmarked Edge, Chrome and Firefox, for Edge's launch,

http://www.winbuzzer.com/2015/07/27/unity-webgl-benchmark-with-asm-js-microsoft-edge-vs-google-chrome-44-vs-firefox-39-xcxwbb/

One surprising thing is that Edge beats us by a lot on Particles (and because of that, they win on the overall score). It loses without asm.js opts, so it seems to be mostly JS perf and not GL, but I'm not certain. Their numbers are:

Particles benchmark
--------------------------
Edge with asm.js    173770
Edge without asm.js  72890
Firefox             106680
Chrome               42210

(higher is better)
The benchmark itself: http://beta.unity3d.com/jonas/WebGLBenchmark/

A quick profile on Mac shows a lot (> 11%) of time in `sin` and > 5% in `cos`. I don't know how fast `sin` is on Windows, but this is worth looking into. See also bug 967709.

Also > 10% under mozilla::WebGLContext::BufferSubData. This probably also depends on the platform/driver.

We should really profile this on Windows.
Keywords: perf
(In reply to Jan de Mooij [:jandem] from comment #1)
> A quick profile on Mac shows a lot (> 11%) of time in `sin` and > 5% in
> `cos`. I don't know how fast `sin` is on Windows, but this is worth looking
> into. See also bug 967709.

Then we should probably help Victor with Bug 984018, and then replace the sincos function by our implementation as suggested by sunfish in Bug 967709.
+Jonas, who wrote the benchmark.

Jonas, what does the Particles test focus on (CPU or GPU, etc.)?
Another approach is to switch to musl implementations of sin and cos (and eventually sincos). I'm developing patches to Emscripten which implement this; the current versions are here:

https://github.com/sunfishcode/emscripten/commit/6efed5fb9bf6c89a8b3b3b0c05adfeb6a825c375
https://github.com/sunfishcode/emscripten-fastcomp/commit/bc299e91b34e5d800a7b124776d60e4a5eb39631
Profile on Windows. glDrawElements is the biggest spender. Sin and Cos take up 11.6% total.
(In reply to Alon Zakai (:azakai) from comment #3)
> +Jonas, who wrote the benchmark.
> 
> Jonas, what does the Particles test focus on (CPU or GPU, etc.)?

It should be mostly CPU heavy (particles are simulated on CPU, and then sent to the GPU each frame by VBO uploads).
Blocks: sm-js-perf
Priority: -- → P3
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: