-
Notifications
You must be signed in to change notification settings - Fork 57
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
added median #19
base: master
Are you sure you want to change the base?
added median #19
Conversation
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.
A couple of minor changes
@@ -104,7 +104,7 @@ def run_benchmarks(control, experiment, benchmark_dir, benchmarks, trials, | |||
control_data=control_data, | |||
experiment_data=experiment_data, | |||
) | |||
print(format_benchmark_result(result, len(control_data.runtimes))) | |||
print(format_benchmark_result(result, len(control_data.runtimes), control_data.runtimes, experiment_data.runtimes, show_median)) |
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.
This line is getting pretty long - perhaps it'd be best to break it on the new trailing comma so it'd be easier to scan – maybe like this?
print(format_benchmark_result(result, len(control_data.runtimes),
control_data.runtimes, …
sorted_runs = sorted(runs) | ||
middle = len(runs) / 2 | ||
if len(runs) % 2 == 0: | ||
return sum(sorted_runs[middle-1:middle+1])/2 |
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.
I generally find this a little easier to read with spaces around the operators
@@ -209,8 +216,7 @@ def insignificant(cls, text): | |||
def bad(cls, text): | |||
return cls.colorize(cls.BAD, text) | |||
|
|||
|
|||
def format_benchmark_result(result, num_points): | |||
def format_benchmark_result(result, num_points, control_data, experiment_data, show_median): |
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.
I'm wondering whether show_median
should be a keyword argument here as well - that list is getting a bit long but it's not too bad.
I left a couple of minor stylistic points above. A larger question: the basic part is whether we should use |
No description provided.