Improve readability of ClusterFinder, add ClusterFinder benchmark#307
Open
lrlunin wants to merge 6 commits into
Open
Improve readability of ClusterFinder, add ClusterFinder benchmark#307lrlunin wants to merge 6 commits into
lrlunin wants to merge 6 commits into
Conversation
…rk, refactored main in benchmarks
Build conda pkgs workflows [failing](https://github.com/slsdetectorgroup/aare/actions/runs/25800676450/job/75789547058#step:5:10) due to the missing `conda build` command. This PR fixes the issue.
AliceMazzoleni99
requested changes
May 27, 2026
| set_target_properties(fit_benchmark PROPERTIES RUNTIME_OUTPUT_DIRECTORY | ||
| ${CMAKE_BINARY_DIR}) | ||
|
|
||
| add_executable(clusterfinder_benchmark clusterfinder_benchmark.cpp) |
Contributor
There was a problem hiding this comment.
You can automatically filter for a specific benchmark using ./run_benchmark --benchmark_filter="benchmarkname". So no need to add a seperate executable.
| aare_compiler_flags) | ||
| target_link_libraries( | ||
| benchmarks PRIVATE benchmark::benchmark benchmark::benchmark_main aare_core | ||
| aare_compiler_flags) |
Contributor
There was a problem hiding this comment.
nice much cleaner than always moving BENCHMARK_MAIN()
| #include <random> | ||
| #include <string> | ||
| #include <vector> | ||
| namespace { |
Contributor
There was a problem hiding this comment.
should it be namespace aare?
| static_cast<int64_t>(n_test_frames)); | ||
| state.SetLabel(label); | ||
| } | ||
| // Wrapper for the old function |
Contributor
There was a problem hiding this comment.
I think a benchmark fixture is better. e.g. BENCHMARK_F. You can have a setup function in the BenchmarkData class
| } | ||
| void find_clusters(NDView<FRAME_TYPE, 2> frame, uint64_t frame_number = 0) { | ||
| void find_clusters(NDView<FRAME_TYPE, 2> frame, uint64_t frame_number = 0, | ||
| bool update_pedestal = true) { |
Contributor
There was a problem hiding this comment.
mmh do you want to store update_pedestal or do you want it as a member variable?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the following PR I slightly changed the ClusterFinder:
update_pedestalsflag to skip pedestal update if it is not needed.Also added a benchmark for ClusterFinder benchmark. The test data is defined via environmental variables. Also removed duplicates of
BENCHMARK_MAINin favor of singlebenchmark::benchmark_maintarget for benchmarks.