Conversation
|
Hmm I may need to rethink the debugging flow. I switched to using the direct build from esbuild, but it seems it does not produce correct source maps (bad debug experience). I was previously using tsx (maps correctly to source), but that doesn't seem to work with enabling |
|
esbuildkit/esm loader had no issues with |
| createMemo, | ||
| createRoot, | ||
| createSignal, | ||
| } from "solid-js/dist/solid.cjs"; |
There was a problem hiding this comment.
Interesting, how did you manage to resolve the browser version instead of the node version?
There was a problem hiding this comment.
Updating type in package.json to module allows loading libraries as esm. And switching moduleResolution to bundler in tsconfig makes TS work with the change.
| excludeLinksFromLockfile: false | ||
|
|
||
| patchedDependencies: | ||
| '@angular/core@16.0.2': |
There was a problem hiding this comment.
Oops, pushed a commit updating this patch (but I would expect this should definitely be required to run the benchmark)
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "vitest", | ||
| "bench:debug": "node --allow-natives-syntax --loader @esbuild-kit/esm-loader src/index.ts", |
There was a problem hiding this comment.
It makes debugging much easier, as you can set breakpoints in the source files of this repo. I tried with esbuild building to dist folder with sourcemaps, which kindof works but the sourcemaps are incorrect leading to breakpoints not matching up correctly to the source, and when walking in the debugger it doesn't show the accurate line which is paused on.
8c3da8a to
c79bf04
Compare
|
Hmm I just realized there is an issue with |
Thank you for the benchmark!
This PR adds some important GC related tests,
collectOutOfScopeConsumersis 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-syntaxv8 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.