From 785802344e9aff3aba0021dc59de7aad14acf5a2 Mon Sep 17 00:00:00 2001 From: IRainman Date: Mon, 10 Mar 2025 05:40:27 +0300 Subject: [PATCH] Tests are updated: When FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN is disabled: #### # reading C:/Projects/fast_float/build/benchmarks/data/canada.txt #### # read 111126 lines ASCII volume = 1.93374 MB fastfloat (64) : 228.57 MB/s (+/- 4.1 %) 13.14 Mfloat/s 76.13 ns/f fastfloat (32) : 226.19 MB/s (+/- 3.1 %) 13.00 Mfloat/s 76.93 ns/f UTF-16 volume = 3.86749 MB fastfloat (64) : 445.30 MB/s (+/- 2.8 %) 12.79 Mfloat/s 78.16 ns/f fastfloat (32) : 439.31 MB/s (+/- 2.1 %) 12.62 Mfloat/s 79.22 ns/f #### # reading C:/Projects/fast_float/build/benchmarks/data/mesh.txt #### # read 73019 lines ASCII volume = 0.536009 MB fastfloat (64) : 123.40 MB/s (+/- 0.8 %) 16.81 Mfloat/s 59.49 ns/f fastfloat (32) : 117.22 MB/s (+/- 1.4 %) 15.97 Mfloat/s 62.62 ns/f UTF-16 volume = 1.07202 MB fastfloat (64) : 243.93 MB/s (+/- 2.6 %) 16.61 Mfloat/s 60.19 ns/f fastfloat (32) : 232.48 MB/s (+/- 2.5 %) 15.83 Mfloat/s 63.15 ns/f c:\Projects\fast_float\build\benchmarks\Release> When FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN is enabled: #### # reading C:/Projects/fast_float/build/benchmarks/data/canada.txt #### # read 111126 lines ASCII volume = 1.82777 MB fastfloat (64) : 233.01 MB/s (+/- 2.0 %) 14.17 Mfloat/s 70.59 ns/f fastfloat (32) : 221.31 MB/s (+/- 1.5 %) 13.46 Mfloat/s 74.32 ns/f UTF-16 volume = 3.65553 MB fastfloat (64) : 460.78 MB/s (+/- 1.4 %) 14.01 Mfloat/s 71.39 ns/f fastfloat (32) : 439.76 MB/s (+/- 2.1 %) 13.37 Mfloat/s 74.80 ns/f #### # reading C:/Projects/fast_float/build/benchmarks/data/mesh.txt #### # read 73019 lines ASCII volume = 0.536009 MB fastfloat (64) : 131.38 MB/s (+/- 0.4 %) 17.90 Mfloat/s 55.87 ns/f fastfloat (32) : 123.03 MB/s (+/- 0.4 %) 16.76 Mfloat/s 59.67 ns/f UTF-16 volume = 1.07202 MB fastfloat (64) : 259.29 MB/s (+/- 1.5 %) 17.66 Mfloat/s 56.62 ns/f fastfloat (32) : 243.71 MB/s (+/- 1.8 %) 16.60 Mfloat/s 60.24 ns/f c:\Projects\fast_float\build\benchmarks\Release> P.S. tested on latest Windows 10 update with latest MSVC 2022 updates on older, but still powerful machine with Intel Xeon E5-2680 v2 --- benchmarks/benchmark.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/benchmarks/benchmark.cpp b/benchmarks/benchmark.cpp index 83493b9..8ec86b8 100644 --- a/benchmarks/benchmark.cpp +++ b/benchmarks/benchmark.cpp @@ -1,3 +1,5 @@ +//#define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN + #if defined(__linux__) || (__APPLE__ && __aarch64__) #define USING_COUNTERS #endif @@ -21,9 +23,11 @@ #include "fast_float/fast_float.h" +#ifdef USING_COUNTERS event_collector collector{}; - +#else std::chrono::high_resolution_clock::time_point t1, t2; +#endif template Value findmax_fastfloat(std::vector> &s, @@ -267,6 +271,7 @@ void fileload(std::string filename) { } int main(int argc, char **argv) { +#ifdef USING_COUNTERS if (collector.has_events()) { std::cout << "# Using hardware counters" << std::endl; } else { @@ -276,6 +281,8 @@ int main(int argc, char **argv) { << std::endl; #endif } +#endif + fileload(std::string(BENCHMARK_DATA_DIR) + "/canada.txt"); fileload(std::string(BENCHMARK_DATA_DIR) + "/mesh.txt"); }