js-reactivity-benchmark
js-reactivity-benchmark copied to clipboard
Add Gc benchmark and Debugging
Thank you for the benchmark!
This PR adds some important GC related tests, collectOutOfScopeConsumers
is most important since it can catch the common issue of out of scope computed's causing memory leaks.
The timings of theses test results aren't really important, but more so if the assertions fail. I first tried making them regular tests instead of benchmarks, but vitest doesn't seem to have any way of accepting the --allow-natives-syntax
v8 argument which means there's no way to trigger GC.
Open to other ideas of how these tests could be better run, one option is calling vitest from node, but I'm not sure if that would work. I use mocha for testing GC stuff in my lib since it allows passing v8 arguments.
It also adds some quality of life tweaks like adding debug path, and allowing esm only libraries by switching tsconfig moduleResolution to bundler.