See in Glossary graphics API uses your GPU for hardware-accelerated rendering. There is a small amount of overhead for translating WebGL API calls and shadersA program that runs on the GPU. More info
See in Glossary to your OS graphics API (typically DirectX on Windows or OpenGL on Mac or Linux).
On the CPU, Emscripten translates your code into WebAssembly, so performance depends on the web browser. For more information, see the Unity blog post WebAssembly Load Times and Performance.
See in Glossary, but some engine parts are normally multi-threaded or SIMD optimized, and therefore with lower performance on WebGL. An example is the skinningThe process of binding bone joints to the vertices of a character’s mesh or ‘skin’. Performed with an external tool, such as Blender or Autodesk Maya. More info
See in Glossary code, which is both multi-threaded and SIMD-optimized.
You can use the new timeline ProfilerA window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating or in your game logic. More info
See in Glossary in Unity to see how Unity distributes work to different threads on non-WebGL platforms.
For best performance, set the optimization level to Fastest in the Build Player dialog, and set Exception support to None in the Player settings for WebGL.
WebGL supports the Unity profiler. See documentation on the Profiler to learn how to set it up.
If Run in background is enabled in the Player settings for the WebGL platform, or if you enable Application.runInBackground, your content continues to run when the canvas or the browser window loses focus.
However, some browsers can throttle content running in background tabs. If the tab with your content is not visible, your content only updates once per second in most browsers. Note that this causes Time.time to progress slower than usual with the default settings, as the default value of Time.maximumDeltaTime is lower than one second.
You might want to run your WebGL content at a lower frame rate in some situations to reduce CPU usage. Like on other platforms, you can use the Application.targetFrameRate API to do so.
When you don’t want to throttle performance, set this API to the default value of –1, rather then to a high value. This allows the browser to adjust the frame rate for the smoothest animation in the browser’s render loop, and might produce better results than Unity trying to do its own main loop timing to match a target frame rate.