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

test: add benchmark GitHub workflow #2234

Merged
merged 10 commits into from
Feb 23, 2024
Merged

test: add benchmark GitHub workflow #2234

merged 10 commits into from
Feb 23, 2024

Conversation

yonadaaa
Copy link
Contributor

@yonadaaa yonadaaa commented Feb 5, 2024

Adds a GitHub Action where we can run benchmarks on a remote machine and inspect the output.

Copy link

changeset-bot bot commented Feb 5, 2024

⚠️ No Changeset found

Latest commit: 239e805

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@yonadaaa yonadaaa marked this pull request as ready for review February 5, 2024 14:25
@yonadaaa yonadaaa requested review from alvrs and holic as code owners February 5, 2024 14:25
@yonadaaa yonadaaa changed the title chore: add benchmark GitHub action chore: add benchmark GitHub workflow Feb 5, 2024
.github/workflows/bench.yml Outdated Show resolved Hide resolved
@alvrs
Copy link
Member

alvrs commented Feb 5, 2024

Is there a way for us to configure the benchmark suite to report absolute numbers instead of relative ones? ("x seconds" vs "x times faster than y")

@alvrs
Copy link
Member

alvrs commented Feb 5, 2024

Also curious if you looked into actions like this one https://github.com/benchmark-action/github-action-benchmark that have built-in support for reporting the benchmark results to a github-pages branch

@yonadaaa
Copy link
Contributor Author

yonadaaa commented Feb 5, 2024

Is there a way for us to configure the benchmark suite to report absolute numbers instead of relative ones? ("x seconds" vs "x times faster than y")

Yes, it logs a full table of stats before "x times faster than y". I'll look into what the numbers mean and see if we can compress them down to something more legible:
image

@yonadaaa
Copy link
Contributor Author

yonadaaa commented Feb 5, 2024

Also curious if you looked into actions like this one https://github.com/benchmark-action/github-action-benchmark that have built-in support for reporting the benchmark results to a github-pages branch

My impression is that most Actions only support certain benchmark tools (ie. not Vitest/tinybench). However github-action-benchmark does mention some custom biggerIsBetter that we can use as an adapter - let me try that too :)

@alvrs
Copy link
Member

alvrs commented Feb 5, 2024

Yes, it logs a full table of stats before "x times faster than y". I'll look into what the numbers mean and see if we can compress them down to something more legible:

Ahh that's great. Somehow didn't find it in the action logs

@yonadaaa
Copy link
Contributor Author

yonadaaa commented Feb 6, 2024

Ahh that's great. Somehow didn't find it in the action logs

I had --silent on some of the runs which I think only prints the "x > y" summary.

.github/workflows/bench.yml Outdated Show resolved Hide resolved
package.json Outdated
@@ -10,6 +10,7 @@
"scripts": {
"all-codegen": "for dir in packages/store packages/world packages/world-modules packages/cli e2e/packages/contracts examples/*/packages/contracts templates/*/packages/contracts; do (cd \"$dir\" && pwd && pnpm build); done",
"all-install": "for dir in . docs e2e examples/* templates/*; do (cd \"$dir\" && pwd && pnpm install); done",
"bench": "pnpm run --filter=store-sync bench",
Copy link
Member

Choose a reason for hiding this comment

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

💪

Copy link
Member

@holic holic Feb 22, 2024

Choose a reason for hiding this comment

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

I think if we do pnpm run --recursive bench, it'll only run packages in the workspace with the bench script

which means we won't have to remember to update this later if we add benchmarks to more packages

holic
holic previously approved these changes Feb 22, 2024
package.json Outdated Show resolved Hide resolved
@holic holic changed the title chore: add benchmark GitHub workflow test: add benchmark GitHub workflow Feb 22, 2024
@yonadaaa yonadaaa merged commit f8af70f into main Feb 23, 2024
12 checks passed
@yonadaaa yonadaaa deleted the yonadaaa/benchmark-action branch February 23, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants