Closed Bug 1247756 Opened 8 years ago Closed 8 years ago

-78% performance impact on a WebGL shadow mapping demo when e10s is enabled.

Categories

(Core :: Graphics: CanvasWebGL, defect)

43 Branch
x86
Windows
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
e10s + ---

People

(Reporter: jujjyl, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf, Whiteboard: gfx-noted)

STR: 

1. Visit https://dl.dropboxusercontent.com/u/40949268/emcc/ShadowMap/ShadowMap_profiler.html

Observed: Performance is about 13fps: https://dl.dropboxusercontent.com/u/40949268/dump/shadowmap_sample_e10s.png

2. Open a new Non-e10s window and navigate to the same page.

Observed: Performance is 60fps: https://dl.dropboxusercontent.com/u/40949268/dump/shadowmap_sample_no_e10s.png

Tested on

HASWELL
-------

Custom built desktop PC
Windows 10 Home 64-bit
3.0 GHz Intel 8-Core i7-5960X
32GB of RAM
3840x2160 pixels display

SLI 2x ASUS NVIDIA GeForce GTX 980 Ti, 12GB of RAM, driver version 361.75
	- nvd3dumx.dll, nvwgf2umx.dll:
		- version 10.18.13.6175
		- date 1/22/2016
		- D3D Version 12.1, WDDM 2.0, WHQL approved

Tried to bisect if this might be a regression, as I can't remember if when I originally developed this sample, whether I was running in e10s or not. Unfortunately one can only bisect backwards to 2015-08 in Windows 10 when e10s is enabled, because a critical hang bug causes Firefox to not load in older builds on Windows 10. At least the following build already had the performance issue:

 0:07.83 INFO: Downloading build from: https://archive.mozilla.org/pub/firefox/nightly/2015/08/2015-08-21-03-02-04-mozilla-central/firefox-43.0a1.en-US.win64.zip
===== Downloaded 100% =====
 0:27.15 INFO: Running mozilla-central build for 2015-08-21
 0:28.72 INFO: Launching c:\users\jukka\appdata\local\temp\tmpwil2g3\firefox\firefox.exe
 0:28.73 INFO: application_buildid: 20150821030204
 0:28.74 INFO: application_changeset: 095988abdc560bf8ba07a94a425c6922a3e9bfd6
 0:28.74 INFO: application_name: Firefox
 0:28.74 INFO: application_repository: https://hg.mozilla.org/mozilla-central
 0:28.74 INFO: application_version: 43.0a1

Marking initially down as a Windows-specific item, since ANGLE has caused a lot of grief in the past, but it could be possible that other platforms have the same issue.
Setting the prefs

webgl.disable-angle;true
webgl.bypass-shader-validation;true

avoid the performance issue even when e10s is enabled.
Also tapping the 'D' key once in the application avoids the performance issue when e10s is enabled (and the above prefs are not set).

The D key toggles whether the rendering enables a redundant dummy color target to the shadow map depth pass, instead of rendering to depth buffer only being bound. That feature was added to debug other Firefox issues (bug 1133161 and bug 953221).
Keywords: perf
Whiteboard: gfx-noted
Flags: needinfo?(gwright)
(In reply to Jukka Jylänki from comment #2)
> Also tapping the 'D' key once in the application avoids the performance
> issue when e10s is enabled (and the above prefs are not set).
> 
> The D key toggles whether the rendering enables a redundant dummy color
> target to the shadow map depth pass, instead of rendering to depth buffer
> only being bound. That feature was added to debug other Firefox issues (bug
> 1133161 and bug 953221).

Can we remove the 60fps cap here for testing? This may be two different issues, where fixing either gives us 60fps again, but fixing both may yield 80fps. (for example)
I have a fairly likely theory for why a depth-only render target might cause perf issues in ANGLE, but I would be extremely surprised if this is only an issue with e10s.

For the e10s ANGLE, we should double-check that we're creating the ANGLE GL context the same way, with the same flags. If non-e10s is getting d3d11 and e10s is getting d3d9, that could help explain why this is e10s-specific.
Here is a vsync-controllable version: https://dl.dropboxusercontent.com/u/40949268/emcc/ShadowMap_novsync/ShadowMap.html

By default, vsync is on. Tap the 'V' key to toggle.

Also a version with cpuprofiler view: https://dl.dropboxusercontent.com/u/40949268/emcc/ShadowMap_novsync/ShadowMap_cpuprofiler.html, although that currently suffers from bug 1249600.

An offline downloadable version: https://dl.dropboxusercontent.com/u/40949268/emcc/ShadowMap_novsync/ShadowMap_novsync.zip
I can't reproduce this on my machine (GTX 960M with 364.72; ANGLE enabled). I see ~90-100fps with vsync disabled in both e10s and non-e10s. Jukka, can you confirm if this is still an issue for you?
Flags: needinfo?(gwright) → needinfo?(jujjyl)
Tested and no longer an issue. Great work!
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(jujjyl)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.