From 8514abe2e281eea16369981623f658f8f032fc5e Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Thu, 5 Mar 2026 21:59:09 -0500 Subject: [PATCH 1/8] Update README with note for C users Added a note for C users to consider ffc.h for high-performance parsing. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c2b2b38..e63db6b 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ [![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) +*Note: This library is for C++ users. C programmers should consider [ffc.h](https://github.com/kolemannix/ffc.h). It is a high-performance port of fast_float to C.* + + The fast_float library provides fast header-only implementations for the C++ from_chars functions for `float` and `double` types as well as integer types. These functions convert ASCII strings representing decimal values (e.g., @@ -10,6 +13,7 @@ These functions convert ASCII strings representing decimal values (e.g., even). In our experience, these `fast_float` functions many times faster than comparable number-parsing functions from existing C++ standard libraries. + Specifically, `fast_float` provides the following two functions to parse floating-point numbers with a C++17-like syntax (the library itself only requires C++11): From a18b614b0ec591e30d74d26e07162b737236fdce Mon Sep 17 00:00:00 2001 From: Koleman Nix Date: Sat, 7 Mar 2026 14:20:13 -0500 Subject: [PATCH 2/8] Mention C under other languages --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e63db6b..c90a632 100644 --- a/README.md +++ b/README.md @@ -492,6 +492,8 @@ Packages [Jackson](https://github.com/FasterXML/jackson-core). * [There is a C# port of the fast_float library](https://github.com/CarlVerret/csFastFloat) called `csFastFloat`. +* There is a [plain C port](https://github.com/kolemannix/ffc.h) (c99) of the fast_float library +called ffc.h ## How fast is it? From b83fdd79cee7db392e54e9913918905bcbedb5f0 Mon Sep 17 00:00:00 2001 From: Koleman Nix Date: Sat, 7 Mar 2026 14:23:07 -0500 Subject: [PATCH 3/8] consistency --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c90a632..cc32162 100644 --- a/README.md +++ b/README.md @@ -492,8 +492,7 @@ Packages [Jackson](https://github.com/FasterXML/jackson-core). * [There is a C# port of the fast_float library](https://github.com/CarlVerret/csFastFloat) called `csFastFloat`. -* There is a [plain C port](https://github.com/kolemannix/ffc.h) (c99) of the fast_float library -called ffc.h +* [There is a plain C port of the fast_float library](https://github.com/kolemannix/ffc.h) called ffc.h ## How fast is it? From 2606bcdf2f0e69dba3c246ff94b32eb0f6f6077e Mon Sep 17 00:00:00 2001 From: Koleman Nix Date: Sat, 7 Mar 2026 15:36:09 -0500 Subject: [PATCH 4/8] A few inlines --- include/fast_float/parse_number.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/fast_float/parse_number.h b/include/fast_float/parse_number.h index c01bb15..008c246 100644 --- a/include/fast_float/parse_number.h +++ b/include/fast_float/parse_number.h @@ -251,7 +251,7 @@ clinger_fast_path_impl(uint64_t mantissa, int64_t exponent, bool is_negative, * parsing options or other parsing custom function implemented by user. */ template -FASTFLOAT_CONSTEXPR20 from_chars_result_t +fastfloat_really_inline FASTFLOAT_CONSTEXPR20 from_chars_result_t from_chars_advanced(parsed_number_string_t &pns, T &value) noexcept { static_assert(is_supported_float_type::value, "only some floating-point types are supported"); @@ -290,7 +290,7 @@ from_chars_advanced(parsed_number_string_t &pns, T &value) noexcept { } template -FASTFLOAT_CONSTEXPR20 from_chars_result_t +fastfloat_really_inline FASTFLOAT_CONSTEXPR20 from_chars_result_t from_chars_float_advanced(UC const *first, UC const *last, T &value, parse_options_t options) noexcept { @@ -456,6 +456,7 @@ template struct from_chars_advanced_caller { template <> struct from_chars_advanced_caller<1> { template + fastfloat_really_inline FASTFLOAT_CONSTEXPR20 static from_chars_result_t call(UC const *first, UC const *last, T &value, parse_options_t options) noexcept { @@ -465,7 +466,7 @@ template <> struct from_chars_advanced_caller<1> { template <> struct from_chars_advanced_caller<2> { template - FASTFLOAT_CONSTEXPR20 static from_chars_result_t + fastfloat_really_inline FASTFLOAT_CONSTEXPR20 static from_chars_result_t call(UC const *first, UC const *last, T &value, parse_options_t options) noexcept { return from_chars_int_advanced(first, last, value, options); @@ -473,7 +474,7 @@ template <> struct from_chars_advanced_caller<2> { }; template -FASTFLOAT_CONSTEXPR20 from_chars_result_t +fastfloat_really_inline FASTFLOAT_CONSTEXPR20 from_chars_result_t from_chars_advanced(UC const *first, UC const *last, T &value, parse_options_t options) noexcept { return from_chars_advanced_caller< From 50c19fad17ec559f8736813b8fa18545f3fb856f Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Tue, 10 Mar 2026 11:53:45 -0400 Subject: [PATCH 5/8] init --- tests/long_test.cpp | 2 +- tests/string_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/long_test.cpp b/tests/long_test.cpp index 40539ef..feab4d0 100644 --- a/tests/long_test.cpp +++ b/tests/long_test.cpp @@ -22,7 +22,7 @@ template bool test() { char const *begin = input.data(); char const *end = input.data() + input.size(); for (size_t i = 0; i < answers.size(); i++) { - T result_value; + T result_value = 0; while ((begin < end) && (std::isspace(*begin))) { begin++; } diff --git a/tests/string_test.cpp b/tests/string_test.cpp index 68828ac..69d2a31 100644 --- a/tests/string_test.cpp +++ b/tests/string_test.cpp @@ -98,7 +98,7 @@ template bool test() { char const *begin = input.data(); char const *end = input.data() + input.size(); for (size_t i = 0; i < answers.size(); i++) { - T result_value; + T result_value = 0; while ((begin < end) && (std::isspace(*begin))) { begin++; } From eb9ab42c0aa86d3cc41871ba7306527d95077b3b Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Tue, 10 Mar 2026 12:10:12 -0400 Subject: [PATCH 6/8] 8.2.4 --- CMakeLists.txt | 2 +- README.md | 6 +++--- include/fast_float/float_common.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a75ad6d..41951d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.14) -project(fast_float VERSION 8.2.3 LANGUAGES CXX) +project(fast_float VERSION 8.2.4 LANGUAGES CXX) set(FASTFLOAT_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for fastfloat") set(CMAKE_CXX_STANDARD ${FASTFLOAT_CXX_STANDARD}) option(FASTFLOAT_TEST "Enable tests" OFF) diff --git a/README.md b/README.md index cc32162..9484ade 100644 --- a/README.md +++ b/README.md @@ -541,7 +541,7 @@ sufficiently recent version of CMake (3.11 or better at least): FetchContent_Declare( fast_float GIT_REPOSITORY https://github.com/fastfloat/fast_float.git - GIT_TAG tags/v8.2.3 + GIT_TAG tags/v8.2.4 GIT_SHALLOW TRUE) FetchContent_MakeAvailable(fast_float) @@ -557,7 +557,7 @@ You may also use [CPM](https://github.com/cpm-cmake/CPM.cmake), like so: CPMAddPackage( NAME fast_float GITHUB_REPOSITORY "fastfloat/fast_float" - GIT_TAG v8.2.3) + GIT_TAG v8.2.4) ``` ## Using as single header @@ -569,7 +569,7 @@ if desired as described in the command line help. You may directly download automatically generated single-header files: - + ## Benchmarking diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index 6bb4c59..bed3efd 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -18,7 +18,7 @@ #define FASTFLOAT_VERSION_MAJOR 8 #define FASTFLOAT_VERSION_MINOR 2 -#define FASTFLOAT_VERSION_PATCH 3 +#define FASTFLOAT_VERSION_PATCH 4 #define FASTFLOAT_STRINGIZE_IMPL(x) #x #define FASTFLOAT_STRINGIZE(x) FASTFLOAT_STRINGIZE_IMPL(x) From 18e55e48a8d0c845c9262eaf1469d3443c228f57 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Tue, 10 Mar 2026 17:06:04 -0400 Subject: [PATCH 7/8] lint --- include/fast_float/parse_number.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/fast_float/parse_number.h b/include/fast_float/parse_number.h index 008c246..ff9c53d 100644 --- a/include/fast_float/parse_number.h +++ b/include/fast_float/parse_number.h @@ -155,7 +155,7 @@ template <> struct from_chars_caller { // if std::float32_t is defined, and we are in C++23 mode; macro set for // float32; set value to float due to equivalence between float and // float32_t - float val; + float val = 0.0f; auto ret = from_chars_advanced(first, last, val, options); value = val; return ret; @@ -172,7 +172,7 @@ template <> struct from_chars_caller { // if std::float64_t is defined, and we are in C++23 mode; macro set for // float64; set value as double due to equivalence between double and // float64_t - double val; + double val = 0.0; auto ret = from_chars_advanced(first, last, val, options); value = val; return ret; @@ -456,8 +456,7 @@ template struct from_chars_advanced_caller { template <> struct from_chars_advanced_caller<1> { template - fastfloat_really_inline - FASTFLOAT_CONSTEXPR20 static from_chars_result_t + fastfloat_really_inline FASTFLOAT_CONSTEXPR20 static from_chars_result_t call(UC const *first, UC const *last, T &value, parse_options_t options) noexcept { return from_chars_float_advanced(first, last, value, options); From 419695eba6f5280f0d25a3d7e52b8bb7583b78c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 00:08:44 +0000 Subject: [PATCH 8/8] Bump the github-actions group across 1 directory with 3 updates Bumps the github-actions group with 3 updates in the / directory: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/setup-node](https://github.com/actions/setup-node) and [jidicula/clang-format-action](https://github.com/jidicula/clang-format-action). Updates `actions/upload-artifact` from 6 to 7 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v6...v7) Updates `actions/setup-node` from 6.2.0 to 6.3.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/6044e13b5dc448c55e2357c09f80417699197238...53b83947a5a98c8d113130e565377fae1a50d02f) Updates `jidicula/clang-format-action` from 4.16.0 to 4.17.0 - [Release notes](https://github.com/jidicula/clang-format-action/releases) - [Commits](https://github.com/jidicula/clang-format-action/compare/6cd220de46c89139a0365edae93eee8eb30ca8fe...3a18028048f01a66653b4e3bf8d968d2e7e2cb8b) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-node dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: jidicula/clang-format-action dependency-version: 4.17.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/cifuzz.yml | 2 +- .github/workflows/emscripten.yml | 2 +- .github/workflows/lint_and_format_check.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml index 2d0bdaa..704d5f1 100644 --- a/.github/workflows/cifuzz.yml +++ b/.github/workflows/cifuzz.yml @@ -20,7 +20,7 @@ jobs: fuzz-seconds: 300 output-sarif: true - name: Upload Crash - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 if: failure() && steps.build.outcome == 'success' with: name: artifacts diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 789aa66..d991a2c 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2 - - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 - uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 - name: Verify run: emcc -v diff --git a/.github/workflows/lint_and_format_check.yml b/.github/workflows/lint_and_format_check.yml index dd30d18..df040ce 100644 --- a/.github/workflows/lint_and_format_check.yml +++ b/.github/workflows/lint_and_format_check.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.1.7 - name: Run clang-format - uses: jidicula/clang-format-action@6cd220de46c89139a0365edae93eee8eb30ca8fe # v4.16.0 + uses: jidicula/clang-format-action@3a18028048f01a66653b4e3bf8d968d2e7e2cb8b # v4.17.0 with: clang-format-version: '17'