UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3511.0 Safari/537.36
Steps to reproduce the problem:
1. Run benchmark at https://jsperf.com/literal-vs-const-vs-member/1 (sourced from discussion at https://stackoverflow.com/a/50532589/) to test performance of access to WebGL constants
2. Compare with manually inlined or frozen objects results
What is the expected behavior?
Ideally, access to constants on `WebGLRenderingContext` and `WebGL2RenderingContext` should perform comparably to manually inlining the values.
What went wrong?
When accessing these constants through `window.{WebGLRenderingContext|WebGL2RenderingContext}`, presumably {`WebGLRenderingContext`|`WebGL2RenderingContext`} access have to be checked (i.e. whether they've been replaced on `window`). However, because this is not typically the case, ideally these accesses could be faster than other globals attached to `window`.
Did this work before? N/A
Chrome version: 70.0.3511.0 Channel: canary
OS Version: 10.0
Flash Version:
It appears that applications are currently using workarounds in order to force inlining or faster access, such as redefining all relevant WebGL constants. It would be useful to avoid this to reduce web application size and use the constants provided by the WebGL API.
Comment 1 by tkent@chromium.org
, Aug 5