Search Unity

Profiler for WebGL?

Discussion in 'Web' started by mikelowefedex, Nov 1, 2020.

  1. mikelowefedex

    mikelowefedex

    Joined:
    Sep 29, 2020
    Posts:
    139
    Hello,
    I finished adding a 'Version 2.0' to my WebGL game in Unity by placing an enemy into the game. In Unity, the game runs a a little slower because of the code it took to program the enemy, and the physics behind the darts. I made it so if you leave the room, the 'instantiated' darts get destroyed, and that seemed to speed up my game a little in Unity, but, when I run it in WebGL, every time I change a room, the game freezes for about 10 seconds, when in Unity, it freezes for about 1 second. The profiler only tells me what is going on in Unity, but is there a way to 'profile' what is happening in WebGL? Thank you.
     
  2. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    953
    There are two ways: either use the profilers embedded in browsers, or use the Unity profiler.

    Using Unity profiler:
    - https://docs.unity3d.com/Manual/Profiler.html
    - https://docs.unity3d.com/Manual/profiler-profiling-applications.html
    -


    Using browser profilers:
    1. Either do a Development build, or even better, do a Release build with Emscripten linker flag "--profiling-funcs" enabled (see option "HTML5 Export/Wasm+Release+Profiling uncompressed..." in the attached script)
    2. Use https://profiler.firefox.com/ if you are using Firefox, or Chrome profiler (https://developers.google.com/web/tools/chrome-devtools/rendering-tools). I recommend using Firefox Profiler, it is amazing in the detail it is able to give.
     

    Attached Files:

    Last edited: Nov 1, 2020