Skip to content
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

Conversation

marco-ippolito
Copy link
Member

Some benchmarks for --experimental-strip-types and --experimental-transform-types.
First time writing a benchmark so open to suggestions

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added the benchmark Issues and PRs related to the benchmark subsystem. label Sep 12, 2024
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/transform-types.js Outdated Show resolved Hide resolved
@RedYetiDev
Copy link
Member

IIRC, dead-code elimination may affect the becnhmark, so setting a variable, and later asserting it will prevent that.

@RedYetiDev RedYetiDev added the strip-types Issues or PRs related to strip-types support label Sep 12, 2024
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
@RafaelGSS
Copy link
Member

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.

@marco-ippolito marco-ippolito force-pushed the benchmark/bench-strip-transform-types branch 2 times, most recently from bdfb933 to b8e57a3 Compare September 12, 2024 13:44
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/strip-types.js Outdated Show resolved Hide resolved
benchmark/ts/transform-types.js Outdated Show resolved Hide resolved
@marco-ippolito marco-ippolito force-pushed the benchmark/bench-strip-transform-types branch 3 times, most recently from 3489ce0 to 5bafadd Compare September 12, 2024 14:02
Copy link
Member

@mcollina mcollina left a 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.

benchmark/ts/typescript.js Outdated Show resolved Hide resolved
@marco-ippolito marco-ippolito force-pushed the benchmark/bench-strip-transform-types branch from 5bafadd to a8d3872 Compare September 18, 2024 12:47
@marco-ippolito
Copy link
Member Author

@mcollina can this land? I believe the request has been resolved since with the query param the modules are not cached

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@marco-ippolito marco-ippolito added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 25, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 25, 2024
@nodejs-github-bot nodejs-github-bot merged commit 00d4f80 into nodejs:main Sep 25, 2024
21 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 00d4f80

targos pushed a commit that referenced this pull request Oct 4, 2024
PR-URL: #54904
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@aduh95 aduh95 mentioned this pull request Oct 9, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
PR-URL: nodejs#54904
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem. strip-types Issues or PRs related to strip-types support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants