[Meta] Investigate WebGL performance issues.

RESOLVED INCOMPLETE

Status

()

Core
Canvas: WebGL
RESOLVED INCOMPLETE
7 years ago
6 years ago

People

(Reporter: mattwoodrow, Unassigned)

Tracking

(Depends on: 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Tracking bug for a variety of performance issues with WebGL including (but not limited to) investigating why chrome more than doubles our Mac OSX WebGL score on jsgamebench (https://developers.facebook.com/blog/post/468/)
(Reporter)

Updated

7 years ago
Depends on: 638323
(Reporter)

Updated

7 years ago
Depends on: 638328
Jeff was investigating this yesterday; this is a **** benchmark doing a zillion WebGL draw-calls, which is inefficient anyway. It could be that we have some room for improvement there though, which would still be worth it. Profiles welcome.
(Reporter)

Comment 2

7 years ago
Created attachment 516717 [details]
Hopefully relevant sections of the profile
(Reporter)

Comment 3

7 years ago
Note that this profile has the patch from 638323 applied, and has all JIT code charged to it's caller.
The only thing that jumps out at me is:

0.9%, mozilla::WebGLContext::ValidateBuffers(int*, char const*), XUL
| 0.9%, mozilla::WebGLContext::ValidateBuffers(int*, char const*), XUL

Investigate possibilities of caching the result of this.


| + 8.0%, nsIDOMWebGLRenderingContext_Uniform3f(JSContext*, unsigned int, unsigned long long*), XUL
| | + 4.7%, mozilla::WebGLContext::Uniform3f(nsIWebGLUniformLocation*, float, float, float), XUL

Wow! This is huge. 8.0-4.7=4.3, so we spend 4.3 % of the total time, and nearly half the time spent in Uniform3f, in XPC/quickstub code!


| + 4.2%, nsIDOMWebGLRenderingContext_BindTexture(JSContext*, unsigned int, unsigned long long*), XUL
| | + 2.6%, mozilla::WebGLContext::BindTexture(unsigned int, nsIWebGLTexture*), XUL

Same here! Again nearly half the time in BindTexture is spent in the glue code between JS and C++.


| + 2.6%, nsIDOMWebGLRenderingContext_Uniform4f(JSContext*, unsigned int, unsigned long long*), XUL
| | + 1.0%, mozilla::WebGLContext::Uniform4f(nsIWebGLUniformLocation*, float, float, float, float), XUL

Same!
> Wow! This is huge. 8.0-4.7=4.3

This was an ex-mathematician being unable to do a substraction anymore.
Yeah, XPC/quickstubs is a major issue in 2D canvas demos as well, e.g. profile data in bug 638241.
Another big issue was the WebGLZeroingObject memory churn, see bug 522193, has a patch.
Depends on: 522193
I boldly claim that this bug is done. Please reopen if you feel differently.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.