You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When there is a p5 component on a page and we navigate to another page, the canvas does not seem to be cleaned up. When we return to the page, another canvas is instantiated. If we browse several pages each containing a canvas, the performance is greatly degraded.
To Reproduce
This issue can be demonstrated on the site of p5-svelte:
Click on the "p5-svelte" button to go back to the main page
Repeat the step 2. and 3. several times
You should notice a decrease in the framerate of the main demo (the update of the fractal canopy become jerky).
This can be measured more accurately using the p5.frameRate() function.
With one of my sites in svelte-kit (ssr), I noticed an increase (invariant of the drawing process) of on average 10ms per frame (60fps, so 16ms => 26ms => 36ms...)
Expected behavior
One should be able to navigate between pages without performance impact. The drawing process should be cleared after leaving the page.
Screenshots Chrome recorded performances on https://p5-svelte.netlify.app/, the green curve represents the DOM nodes that are still held in memory
Describe the bug
When there is a p5 component on a page and we navigate to another page, the canvas does not seem to be cleaned up. When we return to the page, another canvas is instantiated. If we browse several pages each containing a canvas, the performance is greatly degraded.
To Reproduce
This issue can be demonstrated on the site of p5-svelte:
You should notice a decrease in the framerate of the main demo (the update of the fractal canopy become jerky).
This can be measured more accurately using the
p5.frameRate()
function.With one of my sites in svelte-kit (ssr), I noticed an increase (invariant of the drawing process) of on average
10ms
per frame (60fps, so16ms
=>26ms
=>36ms
...)Expected behavior
One should be able to navigate between pages without performance impact. The drawing process should be cleared after leaving the page.
Screenshots
Chrome recorded performances on https://p5-svelte.netlify.app/, the green curve represents the DOM nodes that are still held in memory
Desktop
The text was updated successfully, but these errors were encountered: