-
Notifications
You must be signed in to change notification settings - Fork 5
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 (and default to on) --preview #6
base: master
Are you sure you want to change the base?
Conversation
With this flag, the benchdiff output is rendered between each interleaved run of both the old and new benches (within the current package). Especially for longer benchmark runs, this is helpful to give an idea of what the results are likely going to be. In some cases, this may prompt the user to call it early, thus saving time. But it's also pleasant to be able to just check in, which is my primary motivation for this change.
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.
Nice!
spinner.Update(progress) | ||
var buf bytes.Buffer | ||
if preview { | ||
_, err := processBenchOutput(ctx, &buf, bs1, bs2, true, text, tests, nil) |
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.
[nit] add /* byName */
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.
Should we skip this when j==0
? Not sure what it would show (maybe just the header columns?)
if err != nil { | ||
return err | ||
} | ||
_, _ = fmt.Fprintln(&buf) |
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.
[supernit] There's an extra space because of how we're using the spinner. Maybe add a \n
at the beginning of buf
so it doesn't matter. Or change the spinner to not add the space if prefix
is empty and use an empty prefix.
With this flag, the benchdiff output is rendered between each
interleaved run of both the old and new benches (within the current
package).
Especially for longer benchmark runs, this is helpful to give an idea
of what the results are likely going to be. In some cases, this may
prompt the user to call it early, thus saving time. But it's also
pleasant to be able to just check in, which is my primary motivation
for this change.