Skip to content

Commit

Permalink
wip: add benchmarks comparing several float conv libraries...
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed Nov 12, 2020
1 parent 2086500 commit 141331f
Show file tree
Hide file tree
Showing 12 changed files with 1,589 additions and 702 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ project(c4core
c4_project(VERSION 0.0.1
AUTHOR "Joao Paulo Magalhaes <dev@jpmag.me>")


set(C4CORE_EXT_TO_INSTALL
${C4CORE_SRC_DIR}/c4/ext/debugbreak/debugbreak.h
${C4CORE_SRC_DIR}/c4/ext/sg14/inplace_function.h
Expand Down
36 changes: 35 additions & 1 deletion bm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
c4_setup_benchmarking()

#----------------------------------------------

# libraries to compare

c4_require_subproject(fp
REMOTE
GIT_REPOSITORY https://github.com/jk-jeon/fp
GIT_TAG master
OVERRIDE
#JKJ_FP_ENABLE_SUBPROJECT ON
)

c4_require_subproject(fast_float
REMOTE
GIT_REPOSITORY https://github.com/lemire/fast_float
GIT_TAG v0.1.0)

# ryu requires too much code; use an include for clarity
include(./ryu.cmake)

#----------------------------------------------

c4_add_executable(c4core-bm-charconv
SOURCES bm_charconv.cpp
LIBS c4core benchmark
LIBS c4core benchmark ryu_c4 fast_float
FOLDER bm)

get_property(known_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
if(cxx_std_17 IN_LIST known_features)
target_link_libraries(c4core-bm-charconv PRIVATE jkj_fp)
endif()

c4_add_target_benchmark(c4core-bm-charconv xtoa FILTER "^xtoa_")
c4_add_target_benchmark(c4core-bm-charconv atox FILTER "^atox_")

#----------------------------------------------

option(C4CORE_BM_FLOAT_CMP "compare between alternative implementations for reading/writing floats" ON)
if(C4CORE_BM_FLOAT_CMP)
add_subdirectory(float)
endif()
Loading

0 comments on commit 141331f

Please sign in to comment.