node:assert
's assert.ok(false)
is really slow when using tsx
#548
Labels
node:assert
's assert.ok(false)
is really slow when using tsx
#548
Acknowledgements
Minimal reproduction
(sorry it's inline)
Version
4.9.6
Node.js version
22.0.0
Package manager
pnpm
Operating system
Linux
Problem & expected behavior (under 200 words)
When running
node:assert
'sassert.ok(false)
withtsx
the automatic error message generation becomes notoriously slow.It seems to get slower the larger the file is, and the deeper the function that call's
assert.ok
is.I only tested this with an ESM package, running
node --import tsx/esm repro.ts
.It is not slow if I compile the file and run it without
tsx
.I have a strong belief that
tsx
is interfering with this function, making it really slow. As providing an error message toassert.ok
works around the performance issue.It should be approximately as fast as the compiled version.
No relevant stack traces.
No relevant documentation links.
No relevant screenshots.
Thanks for creating and maintaining this project.
Contributions
The text was updated successfully, but these errors were encountered: