-
Notifications
You must be signed in to change notification settings - Fork 1.1k
bench: replace wall-clock timer with per-process CPU timer #1732
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
base: master
Are you sure you want to change the base?
Changes from all commits
c548af7
aa316b5
d7531ec
a93078f
4f3403e
c0b3be4
e691474
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,12 +125,26 @@ endif() | |
unset(${PROJECT_NAME}_soversion) | ||
|
||
if(SECP256K1_BUILD_BENCHMARK) | ||
add_executable(bench bench.c) | ||
target_link_libraries(bench secp256k1) | ||
add_executable(bench_internal bench_internal.c) | ||
target_link_libraries(bench_internal secp256k1_precomputed secp256k1_asm) | ||
add_executable(bench_ecmult bench_ecmult.c) | ||
target_link_libraries(bench_ecmult secp256k1_precomputed secp256k1_asm) | ||
find_library(RT_LIBRARY rt) | ||
add_library(optional_rt INTERFACE) | ||
if(RT_LIBRARY) | ||
target_link_libraries(optional_rt INTERFACE rt) | ||
endif() | ||
Comment on lines
+128
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please extract this logic into a find-module, like Have a look at the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks compilicated, almost overcomplicated, without much benefits, I won't be able to replicate FindIconv.cmake on my own. but you're welcome to provide a commit and I'll see if it should be cherrypicked. |
||
add_executable(secp256k1_bench bench.c) | ||
add_executable(secp256k1_bench_internal bench_internal.c) | ||
add_executable(secp256k1_bench_ecmult bench_ecmult.c) | ||
target_link_libraries(secp256k1_bench secp256k1 optional_rt) | ||
target_link_libraries(secp256k1_bench_internal secp256k1_precomputed secp256k1_asm optional_rt) | ||
target_link_libraries(secp256k1_bench_ecmult secp256k1_precomputed secp256k1_asm optional_rt) | ||
add_test(NAME secp256k1_bench COMMAND secp256k1_bench) | ||
add_test(NAME secp256k1_bench_internal COMMAND secp256k1_bench_internal) | ||
add_test(NAME secp256k1_bench_ecmult COMMAND secp256k1_bench_ecmult) | ||
set_tests_properties(secp256k1_bench secp256k1_bench_internal secp256k1_bench_ecmult | ||
PROPERTIES | ||
PROCESSORS 1 | ||
PROCESSOR_AFFINITY ON | ||
RUN_SERIAL ON | ||
) | ||
endif() | ||
|
||
if(SECP256K1_BUILD_TESTS) | ||
|
@@ -144,30 +158,30 @@ if(SECP256K1_BUILD_TESTS) | |
list(APPEND TEST_DEFINITIONS SUPPORTS_CONCURRENCY=1) | ||
endif() | ||
|
||
add_executable(noverify_tests tests.c) | ||
target_link_libraries(noverify_tests secp256k1_precomputed secp256k1_asm) | ||
target_compile_definitions(noverify_tests PRIVATE ${TEST_DEFINITIONS}) | ||
add_test(NAME secp256k1_noverify_tests COMMAND noverify_tests) | ||
add_executable(secp256k1_noverify_tests tests.c) | ||
target_link_libraries(secp256k1_noverify_tests secp256k1_precomputed secp256k1_asm) | ||
target_compile_definitions(secp256k1_noverify_tests PRIVATE ${TEST_DEFINITIONS}) | ||
add_test(NAME secp256k1_noverify_tests COMMAND secp256k1_noverify_tests) | ||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Coverage") | ||
add_executable(tests tests.c) | ||
target_compile_definitions(tests PRIVATE VERIFY ${TEST_DEFINITIONS}) | ||
target_link_libraries(tests secp256k1_precomputed secp256k1_asm) | ||
add_test(NAME secp256k1_tests COMMAND tests) | ||
add_executable(secp256k1_tests tests.c) | ||
target_compile_definitions(secp256k1_tests PRIVATE VERIFY ${TEST_DEFINITIONS}) | ||
target_link_libraries(secp256k1_tests secp256k1_precomputed secp256k1_asm) | ||
add_test(NAME secp256k1_tests COMMAND secp256k1_tests) | ||
endif() | ||
unset(TEST_DEFINITIONS) | ||
endif() | ||
|
||
if(SECP256K1_BUILD_EXHAUSTIVE_TESTS) | ||
# Note: do not include secp256k1_precomputed in exhaustive_tests (it uses runtime-generated tables). | ||
add_executable(exhaustive_tests tests_exhaustive.c) | ||
target_link_libraries(exhaustive_tests secp256k1_asm) | ||
target_compile_definitions(exhaustive_tests PRIVATE $<$<NOT:$<CONFIG:Coverage>>:VERIFY>) | ||
add_test(NAME secp256k1_exhaustive_tests COMMAND exhaustive_tests) | ||
add_executable(secp256k1_exhaustive_tests tests_exhaustive.c) | ||
target_link_libraries(secp256k1_exhaustive_tests secp256k1_asm) | ||
target_compile_definitions(secp256k1_exhaustive_tests PRIVATE $<$<NOT:$<CONFIG:Coverage>>:VERIFY>) | ||
add_test(NAME secp256k1_exhaustive_tests COMMAND secp256k1_exhaustive_tests) | ||
endif() | ||
|
||
if(SECP256K1_BUILD_CTIME_TESTS) | ||
add_executable(ctime_tests ctime_tests.c) | ||
target_link_libraries(ctime_tests secp256k1) | ||
add_executable(secp256k1_ctime_tests ctime_tests.c) | ||
target_link_libraries(secp256k1_ctime_tests secp256k1) | ||
endif() | ||
|
||
if(SECP256K1_INSTALL) | ||
|
Uh oh!
There was an error while loading. Please reload this page.