From 3e86e9a18eb59938b922ab5e43a709d5dd826813 Mon Sep 17 00:00:00 2001 From: IRainman Date: Mon, 10 Mar 2025 05:40:27 +0300 Subject: [PATCH] #### # 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> --- benchmarks/benchmark.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/benchmarks/benchmark.cpp b/benchmarks/benchmark.cpp index 83493b9..60009b0 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"); }