-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: allow customizing the bench runner #14
Open
katcipis
wants to merge
6
commits into
main
Choose a base branch
from
customize-bench-runner
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
567cdce
refactor: parametrize bench runner
katcipis 6b79728
feat: add support to customized benchmark commands
katcipis d40ee55
chore: improve docs
katcipis 438946f
chore: remove integration tests for now
katcipis 5b19e28
chore: improve error message by wrapping error
katcipis f8f2ad3
docs: add jtoh run example
katcipis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,26 +39,29 @@ have information on memory allocations. | |
Comparing performance between two versions of a Go module | ||
and just showing results on output (no check performed): | ||
|
||
``` | ||
benchcheck cool.go.module v0.0.1 v0.0.2 | ||
```sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docs were also wrong...sorry for that :-) |
||
benchcheck -mod cool.go.module -old v0.0.1 -new v0.0.2 | ||
``` | ||
|
||
Comparing performance between two versions of a Go module | ||
and failing on time regression: | ||
|
||
``` | ||
benchcheck cool.go.module v0.0.1 v0.0.2 -time-delta +13.31% | ||
``` | ||
|
||
Now doing the same but also checking for allocation regression: | ||
|
||
``` | ||
benchcheck cool.go.module v0.0.1 v0.0.2 -alloc-delta +15% -allocs-delta +20% | ||
```sh | ||
benchcheck -mod cool.go.module -old v0.0.1 -new v0.0.2 -check time/op=13.31% | ||
``` | ||
|
||
You can also check if your code got faster and use the check to | ||
I don't know... Celebrate ? =P | ||
|
||
```sh | ||
benchcheck -mod cool.go.module -old v0.0.1 -new v0.0.2 -check time/op=-13.31% | ||
``` | ||
benchcheck cool.go.module v0.0.1 v0.0.2 -time-delta -20% | ||
|
||
Now lets say you want to customize how the benchmarks are run, just add the command that you wish | ||
to be executed to run the benchmarks like this: | ||
|
||
```sh | ||
benchcheck -mod cool.go.module -old v0.0.1 -new v0.0.2 -- go test -bench=BenchmarkSpecific ./specific/pkg | ||
``` | ||
|
||
It can be any command that will generate benchmark results with the same formatting as `go test` benchmarks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe we could remove some Go releases here, even though it works on older Go versions (make CI faster).
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.
yep, makes sense