mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-09-03 09:50:42 +02:00
Optimized pedestal tracking with FastPedestal and performance improvements to the cluster finder. - ~2x faster hitting 14k FPS on benchmark dataset on 16 core threadripper pro **Changes** - No bounds check on interior of frame. (only within half of a cluster) (~15% improvement) - Cache threshold (std*n_rms) Biggest improvement comes from not computing std for each access - Cache pedestal subtracted frame - Switched to FastPedestal which assumes we reached steady state **Things tried but rejected:** - Always store cluster values, commit on val==max (~15% drop in frame rate) **Options** - using 16 bit clusters and 16 bit pedestal. (slows down the single threaded case but allow us to reach 12k with multi threading) **Other notes on performance** - Passing in memory frames from python and doing nothing: 0.8us/frame - Passing + pedestal subtraction: 28us/frame - Passing + pedestal + cluster finding (no store): 652us/frame - Passing + pedestal + cluster finding: 886 us/frame
41 lines
1.3 KiB
CMake
41 lines
1.3 KiB
CMake
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
benchmark
|
|
GIT_REPOSITORY https://github.com/google/benchmark.git
|
|
GIT_TAG v1.8.3 # Change to the latest version if needed
|
|
)
|
|
|
|
# Ensure Google Benchmark is built correctly
|
|
set(BENCHMARK_ENABLE_TESTING
|
|
OFF
|
|
CACHE BOOL "" FORCE)
|
|
|
|
FetchContent_MakeAvailable(benchmark)
|
|
|
|
add_executable(benchmarks)
|
|
|
|
target_sources(
|
|
benchmarks PRIVATE ndarray_benchmark.cpp ndview_benchmark.cpp
|
|
calculateeta_benchmark.cpp reduce_benchmark.cpp)
|
|
|
|
# Link Google Benchmark and other necessary libraries
|
|
target_link_libraries(benchmarks PRIVATE benchmark::benchmark aare_core
|
|
aare_compiler_flags)
|
|
|
|
# Set output properties
|
|
set_target_properties(
|
|
benchmarks PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
OUTPUT_NAME run_benchmarks)
|
|
|
|
add_executable(fit_benchmark fit_benchmark.cpp)
|
|
target_link_libraries(fit_benchmark PRIVATE benchmark::benchmark aare_core
|
|
aare_compiler_flags)
|
|
target_include_directories(
|
|
fit_benchmark SYSTEM
|
|
PRIVATE $<TARGET_PROPERTY:Minuit2::Minuit2,INTERFACE_INCLUDE_DIRECTORIES>)
|
|
set_target_properties(fit_benchmark PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
${CMAKE_BINARY_DIR})
|