What causes the 1.5 second + freeze when starting an HTML5 game, and how can it be mitigated?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Giwayume

I’ve exported a blank project as an HTML5 game. Shortly after the progress bar completes, the game freezes for 1.5 seconds, then it displays and runs as normal.

It looks like one of the requestAnimationFrame callbacks runs for the entirety of this pause. Is this the game decompressing the pck/wasm file or something?

I feel like any long blocking process like this should show up as part of the loading progress bar, and be handled in a web worker so it doesn’t freeze the browser tab.

enter image description here

Please report your findings on GitHub so the engine developers can look at it.

Calinou | 2020-06-29 13:30