-
Notifications
You must be signed in to change notification settings - Fork 29.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
benchmark: create benchmark for typescript #54904
base: main
Are you sure you want to change the base?
benchmark: create benchmark for typescript #54904
Conversation
Review requested:
|
IIRC, dead-code elimination may affect the becnhmark, so setting a variable, and later asserting it will prevent that. |
There's no guarantee on that. It's just an assumption that might not be true. However, it's recommended to do it. |
bdfb933
to
b8e57a3
Compare
3c71807
to
3489ce0
Compare
3489ce0
to
5bafadd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only way to measure this is by spawning a new process or possibly a worker thread.
let output; | ||
bench.start(); | ||
for (let i = 0; i < n; i++) { | ||
const { result } = await import(filepath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will just hit the module cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about <filepath>?${i}
? (I don't know too much about the module cache)
Some benchmarks for
--experimental-strip-types
and--experimental-transform-types
.First time writing a benchmark so open to suggestions