-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BENCH: Add benchmarks targeted at small arrays #21463
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
Conversation
Rather than create new benchmarks, could we extend the current ones with smaller arrays? |
bae9511
to
44a7e37
Compare
Sure. I moved them into the existing benchmarks. Let me know if I should move them to some other location or if some of tests are added are redundant. @mattip |
benchmarks/benchmarks/bench_core.py
Outdated
|
||
def time_mean_axis(self): | ||
np.mean(self.array_4_5, axis=1) | ||
|
||
|
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.
It turns out we do not bencmark np.mean
. I think this belongs in bench_functions_base.py
, since that is where median
, percentile
and other numeric functions are checked.
44a7e37
to
2534a7c
Compare
Thanks @eendebakpt |
This PR adds a benchmark file specifically targeted at small arrays and scalars.
The goal is to benchmark the overhead of the various numpy methods. For benchmarks with large arrays (e.g. size > 1e6) the overhead is small compared to the actual computation, but for small arrays it is not.