generated from tweakpane/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Thank you for this superb library!
I noticed creeping memory usage when repeatedly setting the value of a cubicbezier blade.
A minimal (but admittedly extreme) reproduction is something like this. After about five minutes, I see several hundred megabytes of usage in the tab.
Maybe CubicBezier value objects are being retained somewhere internally? Manually invoking GC helps a bit but still doesn't completely stop the accumulation.
<script type="module">
import * as Tweakpane from 'https://unpkg.com/[email protected]/dist/tweakpane.js';
import * as EssentialsPlugin from 'https://unpkg.com/@tweakpane/[email protected]/dist/tweakpane-plugin-essentials.js';
const pane = new Tweakpane.Pane({ title: 'Cubic Bezier Stress Test' });
pane.registerPlugin(EssentialsPlugin);
const bezierApi = pane.addBlade({
view: 'cubicbezier',
value: [0, 0, 0, 0],
});
setInterval(() => {
bezierApi.value = new EssentialsPlugin.CubicBezier(
Math.random(),
Math.random(),
Math.random(),
Math.random()
);
}, 4);
</script>Metadata
Metadata
Assignees
Labels
No labels