Add benchmarks for morphology.local_maxima#3255
Conversation
|
Hello @lagru! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-09-13 16:12:28 UTC |
|
@lagru do you have a reference for how long these benchmarks take? I feel like the parameter matrix might be a bit too big. And I would argue that running You can run these locally quite easily. See the "asv run" help: http://asv.readthedocs.io/en/latest/commands.html You should probably limit yourself to a single environment from the benchmark matrix, as the envs take quite a while to make. |
|
@jni Ha 😄, and here I expected that you'd have asked for benchmarks for I haven't used I'm happy to do a quick check on my machine although I doubt that my notebook is a good reference.
It's a little bit faster if one uses |
Codecov Report
@@ Coverage Diff @@
## master #3255 +/- ##
=======================================
Coverage 86.86% 86.86%
=======================================
Files 340 340
Lines 27484 27484
=======================================
Hits 23874 23874
Misses 3610 3610Continue to review full report at Codecov.
|
|
@jni On my machine (4 x Intel Core i5-4200U CPU @ 1.60GHz) running the 4 remaining benchmarks takes roughly 1 Minute and 20 seconds for 1 commit and 1 environment. If you still want to reduce the parameter matrix we could remove the parameter "indices" which only really measures the difference induced by |
|
@lagru I would say that's about an order of magnitude too long. The only requirement is that it's long enough that we can get an accurate benchmark. So we should aim for an individual benchmark to run in ~1s, I think. |
|
@lagru why not just reduce the size of the 3D image by reducing the sidelength of the cube, e.g. from (10, 10, 10) to (5, 5, 5)? That should give an 8x reduction in runtime, while testing the exact same principles? |
|
@jni That has not much of an effect; the benchmarks take essentially the same time. The size of the array doesn't seem to be the factor here. Even if I use only really small arrays the 4 benchmarks take roughly 20 s. Of note is that these results are only true for the development version of asv (0.3.dev1274+a88114ce); for the most recent release 0.2.1 all 4 benchmarks take 45 seconds! At this stage I really think that testing on my weak CPU may not be a good reference point. And I really want to avoid reducing the parameter matrix further because I think it's quite valuable to see the algorithms performance for different connectivity and border behavior. Oh and I found a small bug: |
|
@lagru If you think that you can open a PR in a short term, then fine. Otherwise, you are invited to open an issue to do not forget. :) |
dd802cd to
1603187
Compare
1603187 to
25a5e5f
Compare
25a5e5f to
763a995
Compare
|
Benchmark suite won't pass currently. See #4176 for a fix. |
1adc0c3 to
e2a36e5
Compare
|
Hey @lagru!! 😉 Is this PR still relevant? The fourth task (out of four) is not relevant anymore; it may be either checked off or removed. |
This is a minimal benchmark that only tests the 2D case.
e2a36e5 to
be1eb8c
Compare
|
@mkcor, relevant in as much that more benchmarks don't hurt? I updated it and would say it's ready to go. |
Co-authored-by: Marianne Corvellec <marianne.corvellec@ens-lyon.org>
@lagru definitely! Since there hadn't been any activity in a while (:zzz: Dormant :wink:), I was wondering if maybe it was outdated. I guess this PR had simply fallen in the cracks! Should I wait for @jni's approval before merging? Or would you like to remove this review request? |
|
I guess it had just fallen out of sight. I was wondering how you found this. 😄 As far as I'm aware I addressed all of @jni's feedback so I'm happy to get this merged. |
Basically two cases are benchmarked: A natural 2d image with many small extrema and a synthetic 3D "image" with few large extrema. The memory behavior of the latter is especially interesting because it requires the internal queue to grow quite a bit.
Checklist
later.
Check that new functions are imported in corresponding__init__.py.Check that new features, API changes, and deprecations are mentioned in
doc/release/release_dev.rst.Consider backporting the PR with@meeseeksdev backport to v0.14.x