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

Add CLI startup speed benchmark #7617

Merged
merged 1 commit into from
Jul 10, 2023
Merged

Add CLI startup speed benchmark #7617

merged 1 commit into from
Jul 10, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Jul 10, 2023

Changes

  • Support pnpm astro-benchmark cli-startup in root
  • Support !bench cli-startup in PR comments (once merged)

Example output:

Making project: render-default
Finished making project: render-default
Benchmarking `astro --help`...
Done
Benchmarking `astro info`...
Done
Result preview:
==========
#### CLI Startup


| Command      | Avg (ms) | Stdev (ms) | Max (ms) |
| :----------- | -------: | ---------: | -------: |
| astro --help |   434.98 |      21.17 |   492.63 |
| astro info   |   468.74 |      28.54 |   527.03 |
==========

Testing

Ran pnpm astro-benchmark cli-startup locally. I did not test if the !bench PR comment would work, but it should following the other patterns.

Docs

n/a. The !bench command should be documented in CONTRIBUTING in general.

@changeset-bot
Copy link

changeset-bot bot commented Jul 10, 2023

⚠️ No Changeset found

Latest commit: 0eecda8

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jul 10, 2023
printRow('Package manager', packageManager.name);
printRow('Package manager', packageManager?.name);
Copy link
Member Author

Choose a reason for hiding this comment

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

Forgot to put a note. This was needed because running node /path/to/astro.js directly yields no package manager, so adding the ?. to prevent an error while running the benchmark.

Copy link
Member

Choose a reason for hiding this comment

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

We could fix it by adding a "Could not determine." label, I'll send a PR

@bluwy bluwy merged commit 255dead into main Jul 10, 2023
13 checks passed
@bluwy bluwy deleted the benchmark-cli branch July 10, 2023 15:43
ematipico pushed a commit that referenced this pull request Jul 11, 2023
matthewp pushed a commit that referenced this pull request Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants