We're seeing some hitches in a game we're developing that uses embedded webkit(Coherent GT) for the UI and I've narrowed this down to what appears to be GC pressure created when using reactive variables.
We're updating reactive variables within our components nearly every frame for things like health & positions. In a normal web app, the GC times we're seeing(can get up to 20ms) wouldn't be an issue, but our UI has a small budget for each frame (~3ms).
I'm able to repro this in latest chrome with the following component in svelte 3.18.2:
Here's what the memory profile in chrome looks like when not using reactive variables:
I've looked at the generated output and tried to narrow down what might be causing a lot of the extra allocation, but haven't been able to nail anything down yet. Any help would be appreciated!
We're seeing some hitches in a game we're developing that uses embedded webkit(Coherent GT) for the UI and I've narrowed this down to what appears to be GC pressure created when using reactive variables.
We're updating reactive variables within our components nearly every frame for things like health & positions. In a normal web app, the GC times we're seeing(can get up to 20ms) wouldn't be an issue, but our UI has a small budget for each frame (~3ms).
I'm able to repro this in latest chrome with the following component in svelte 3.18.2:
Here's what the memory looks like when profiling in chrome:
A different approach that doesn't use reactive variables does not have this issue:
Here's what the memory profile in chrome looks like when not using reactive variables:
I've looked at the generated output and tried to narrow down what might be causing a lot of the extra allocation, but haven't been able to nail anything down yet. Any help would be appreciated!