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

Repair benchmarks #3347

Merged
merged 1 commit into from
Oct 8, 2024
Merged

Repair benchmarks #3347

merged 1 commit into from
Oct 8, 2024

Conversation

steveluscher
Copy link
Collaborator

Summary

Because we moved a build-time contstant to the top level in #3340, we can no longer run these scripts without replacing the build time constants. That means that running this with tsx will yield a __NODEJS__ is not defined error.

In this PR, we change the benchmarks to run on the built source, and teach Turborepo to build it beforehand. You now run benchmarks with pnpm turbo benchmark.

Copy link

changeset-bot bot commented Oct 7, 2024

⚠️ No Changeset found

Latest commit: 97d27f9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @steveluscher and the rest of your teammates on Graphite Graphite

Copy link
Collaborator Author

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

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

Unless anyone knows of a better way to run a script with tsx and replace build-time constants on the fly?

@steveluscher steveluscher force-pushed the 10-07-repair_benchmarks branch from 8b75e90 to 2ccc1ea Compare October 7, 2024 16:43
Comment on lines 7 to 8
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These ignore directives imply that these benchmarks will break frequently without warning, but I don't know of any other way to:

  1. Refer to the built source
  2. Before it exists
  3. In a way that will typecheck

Copy link
Contributor

@mcintyre94 mcintyre94 Oct 7, 2024

Choose a reason for hiding this comment

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

Could we run these benchmarks in the CI, perhaps only on main if they're expensive? Just so we know if we break them, rather than having to debug when we need to run them and find them bust.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I figured it out.

@steveluscher steveluscher force-pushed the 10-07-repair_benchmarks branch 2 times, most recently from 048ef45 to c38c6bc Compare October 8, 2024 00:18
@steveluscher steveluscher added the automerge Merge this Pull Request automatically once CI passes label Oct 8, 2024 — with Graphite App
@steveluscher steveluscher force-pushed the 10-07-repair_benchmarks branch from c38c6bc to 97d27f9 Compare October 8, 2024 00:19
@mergify mergify bot merged commit db7e736 into master Oct 8, 2024
9 checks passed
@mergify mergify bot deleted the 10-07-repair_benchmarks branch October 8, 2024 00:31
Copy link
Contributor

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants