-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Suggestion: Use hyperfine instead of time to perform timing measurements #105
Comments
I made a script using TEMP_FILE=$(mktemp)
OPTS="--warmup 2 --runs 5 --export-json $TEMP_FILE"
JAVA_OPTS=""
hyperfine $OPTS \
'java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar dev.morling.onebrc.CalculateAverage_hundredwatt' \
'java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar dev.morling.onebrc.CalculateAverage_<COMPARE TO FORK>'
# The slowest and the fastest runs are discarded
# The mean value of the remaining three runs is the result for that contender
jq -r '.results[] | .command, ((.times | sort) | .[1:-1] | add / length)' $TEMP_FILE |
Oh, very cool! Could you PR this script? I probably shouldn't change the way of evaluating in the middle of the challenge, but it's good to have for future reference and ad-hoc testing. Thx! |
Sure! Here's the PR: #182 |
Awesome, thanks. That's a great start. We'd have to factor out though the call to |
Yes, hyperfine $OPTS \
--prepare './prepare_<fork1>.sh' \
'./calculate_average_<fork1>.sh' \
--prepare './prepare_<fork2>.sh' \
'./calculate_average_<fork2>.sh' But we still need to solve the sdkman issue (https://twitter.com/jasonnochlin/status/1744399656266629365) |
Resolved on Twitter (https://twitter.com/gunnarmorling/status/1744413791272468607):
|
Done. Thx a lot, @hundredwatt, great work! Makes the eval process much, much smoother now! |
My less than 10 line POC above has turned into a 300 line behemoth 😂 I hope I made managing this contest a little less tedious for you @gunnarmorling! Thanks again for creating it! |
Suggestion: Use
hyperfine
instead oftime
for performing timing measurements. It can automatically perform multiple runs and print statistical timing data on those runs.Maybe I'll find time on the weekend to provide a PR for this.
The text was updated successfully, but these errors were encountered: