Skip to content

Commit 3d83d19

Browse files
Merge branch 'fastfloat:main' into main
2 parents d4c573d + 0a17150 commit 3d83d19

File tree

11 files changed

+1718
-2
lines changed

11 files changed

+1718
-2
lines changed

.github/workflows/ubuntu24.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
run: |
1212
mkdir build &&
1313
cd build &&
14-
CXXFLAGS=-Werror cmake -DFASTFLOAT_TEST=ON .. &&
14+
CXXFLAGS=-Werror cmake -DFASTFLOAT_TEST=ON -D FASTFLOAT_BENCHMARKS=ON .. &&
1515
cmake --build . &&
1616
ctest --output-on-failure
1717
- name: Use cmake CXX23

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ project(fast_float VERSION 7.0.0 LANGUAGES CXX)
44
set(FASTFLOAT_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for fastfloat")
55
set(CMAKE_CXX_STANDARD ${FASTFLOAT_CXX_STANDARD})
66
option(FASTFLOAT_TEST "Enable tests" OFF)
7+
78
if(FASTFLOAT_TEST)
89
enable_testing()
910
add_subdirectory(tests)
@@ -29,6 +30,16 @@ if(FASTFLOAT_INSTALL)
2930
endif()
3031

3132
add_library(fast_float INTERFACE)
33+
34+
35+
option(FASTFLOAT_BENCHMARKS "Enable benchmarks" OFF)
36+
if(FASTFLOAT_BENCHMARKS)
37+
add_subdirectory(benchmarks)
38+
else(FASTFLOAT_BENCHMARKS)
39+
message(STATUS "Benchmarks are disabled. Set FASTFLOAT_BENCHMARKS to ON to build benchmarks (assumes C++17).")
40+
endif(FASTFLOAT_BENCHMARKS)
41+
42+
3243
add_library(FastFloat::fast_float ALIAS fast_float)
3344
target_include_directories(
3445
fast_float

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
## fast_float number parsing library: 4x faster than strtod
33

4-
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/fast_float.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:fast_float)
54
[![Ubuntu 22.04 CI (GCC 11)](https://github.com/fastfloat/fast_float/actions/workflows/ubuntu22.yml/badge.svg)](https://github.com/fastfloat/fast_float/actions/workflows/ubuntu22.yml)
65

76
The fast_float library provides fast header-only implementations for the C++

benchmarks/CMakeLists.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
add_executable(realbenchmark benchmark.cpp)
2+
set_property(
3+
TARGET realbenchmark
4+
PROPERTY CXX_STANDARD 17)
5+
6+
target_link_libraries(realbenchmark PUBLIC fast_float)
7+
include(ExternalProject)
8+
9+
# Define the external project
10+
ExternalProject_Add(simple_fastfloat_benchmark
11+
GIT_REPOSITORY https://github.com/lemire/simple_fastfloat_benchmark.git
12+
GIT_TAG master # or specify a particular commit/tag/branch
13+
SOURCE_DIR ${CMAKE_BINARY_DIR}/simple_fastfloat_benchmark
14+
BINARY_DIR ${CMAKE_BINARY_DIR}/simple_fastfloat_benchmark-build
15+
CONFIGURE_COMMAND ""
16+
BUILD_COMMAND ""
17+
INSTALL_COMMAND ""
18+
)
19+
set(DATA_DIR ${CMAKE_BINARY_DIR}/simple_fastfloat_benchmark/data)
20+
21+
add_custom_target(CopyData ALL
22+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${DATA_DIR} ${CMAKE_CURRENT_BINARY_DIR}/data
23+
DEPENDS simple_fastfloat_benchmark
24+
)
25+
add_dependencies(realbenchmark CopyData)
26+
target_compile_definitions(realbenchmark PUBLIC BENCHMARK_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/data")

0 commit comments

Comments
 (0)