Skip to content

reduce overhead of println #73

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

Closed
wants to merge 1 commit into from

Conversation

tathanhdinh
Copy link
Contributor

This PR tries to reduce the (tiny) overhead that println! may make (because of locks and since stdout is line-buffered). I don't think that using a buffered writer over stdout will make a noticeable performance gain in this case, so feel free to reject it if you don't like.

@sharkdp
Copy link
Owner

sharkdp commented Aug 27, 2018

I don't think that using a buffered writer over stdout will make a noticeable performance gain in this case

I also don't think so. Within hyperfine itself, I don't think we have to care about performance too much because a typical run of hyperfine will be completely dominated by the actual benchmarking time (which is on the order of seconds) whereas everything else (calculations, output) will run in a few milliseconds.

The println!-based code is a bit easier and clearer, so I'd like to keep it.

Anyway, thank you very much for your contribution 👍

@sharkdp sharkdp closed this Aug 27, 2018
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.

2 participants