Significant FPS drops when dynamically loading sprite sheets

Hello everyone,

I’m encountered a problem with dynamic sprite sheet loading in Phaser JS. When new sprite sheets are loaded, the game experiences significant glitches and FPS drops, which persist until the loading is fully completed.

I’ve implemented a system to load only one sprite sheet at a time. This has slightly improved the situation, but the problem still remains and is quite frustrating. Additionally, Google Chrome Dev Tools Performance Monitor reports long tasks during the loading process.

Does anyone have any ideas on how to optimize the dynamic loading of sprite sheets to avoid these lags and FPS drops? Any suggestions would be greatly appreciated!

Thank you in advance!

I think that may be unavoidable. Are these large images?

The images are quite large (example: 2266x1940 4.30MB) because I need to create animations for isometric sprites. I can’t load all the sprite sheets at once since there are too many, and they are only loaded when necessary (for example, when a sprite with a specific texture appears on the map).