last week i recognized that if i test my app on firefox there is a huge freeze in the start of the app. In chrome it is less noticeable but also there. I tested in both browsers and found the issue. The function calls WebGL2RenderingContext.getProgramParameter needs a lot of time to run. I read about it basically initializing the shaders in the gpu and therefore blocking the main thread until it finishes right? Here comes my question, is there a way to divide the shader initialization into smaller chunks to remove the freeze? The idea is to let the app load a bit longer and initialize not everything at once but one after another. Has anyone experience with this kind of problem?
@manthrax yes that would exactly be the approach i want to try. Do you have experience with it? My fear is, that the app will then not freeze once for 1.5s but stutter for ~3s but is also not clickable at that time.
What i forgot to mention. The main reason this behavior is not wanted is the fact that on the side of my configurator there is a UI to control it. The user cannot interact with the UI while .getProgramParameter() runs. It is no option to show the UI later and hide the freeze behind a loading state!
You can throw up a loading spinner .gif
gifs usually animate on a different thread than the main js thread, so even if the js thread is stalled, the gif can still animate and indicate the app is “doing something”.
good idea but the problem is that the user should be able to interact with the UI on the side, that freezes aswell. The freezing of the UI is the main problem because the user should be able to interact while the configurator loads.