mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
benchmarks are improved: back to the cycle metering because when USING_COUNTERS is enabled it's consumed to much resources.
This commit is contained in:
parent
0188112c8f
commit
ffd3590a42
@ -1,4 +1,51 @@
|
||||
#define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
||||
/*
|
||||
####
|
||||
# reading C:/Projects/fast_float/build/benchmarks/data/canada.txt
|
||||
####
|
||||
# read 111126 lines
|
||||
ASCII volume = 1.93374 MB
|
||||
fastfloat (64) : 188.96 MB/s (+/- 3.1 %) 10.86 Mfloat/s 92.09 ns/f
|
||||
fastfloat (32) : 229.56 MB/s (+/- 5.6 %) 13.19 Mfloat/s 75.80 ns/f
|
||||
UTF-16 volume = 3.86749 MB
|
||||
fastfloat (64) : 446.29 MB/s (+/- 5.5 %) 12.82 Mfloat/s 77.98 ns/f
|
||||
fastfloat (32) : 440.58 MB/s (+/- 5.4 %) 12.66 Mfloat/s 78.99 ns/f
|
||||
####
|
||||
# reading C:/Projects/fast_float/build/benchmarks/data/mesh.txt
|
||||
####
|
||||
# read 73019 lines
|
||||
ASCII volume = 0.536009 MB
|
||||
fastfloat (64) : 125.54 MB/s (+/- 2.6 %) 17.10 Mfloat/s 58.47 ns/f
|
||||
fastfloat (32) : 118.63 MB/s (+/- 2.9 %) 16.16 Mfloat/s 61.88 ns/f
|
||||
UTF-16 volume = 1.07202 MB
|
||||
fastfloat (64) : 246.08 MB/s (+/- 2.3 %) 16.76 Mfloat/s 59.66 ns/f
|
||||
fastfloat (32) : 234.03 MB/s (+/- 2.9 %) 15.94 Mfloat/s 62.73 ns/f
|
||||
*/
|
||||
|
||||
//#define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
||||
|
||||
/*
|
||||
####
|
||||
# reading C:/Projects/fast_float/build/benchmarks/data/canada.txt
|
||||
####
|
||||
# read 111126 lines
|
||||
ASCII volume = 1.82777 MB
|
||||
fastfloat (64) : 232.92 MB/s (+/- 4.3 %) 14.16 Mfloat/s 70.62 ns/f
|
||||
fastfloat (32) : 221.19 MB/s (+/- 3.8 %) 13.45 Mfloat/s 74.36 ns/f
|
||||
UTF-16 volume = 3.65553 MB
|
||||
fastfloat (64) : 460.42 MB/s (+/- 5.2 %) 14.00 Mfloat/s 71.45 ns/f
|
||||
fastfloat (32) : 438.06 MB/s (+/- 5.6 %) 13.32 Mfloat/s 75.09 ns/f
|
||||
####
|
||||
# reading C:/Projects/fast_float/build/benchmarks/data/mesh.txt
|
||||
####
|
||||
# read 73019 lines
|
||||
ASCII volume = 0.536009 MB
|
||||
fastfloat (64) : 131.35 MB/s (+/- 1.5 %) 17.89 Mfloat/s 55.89 ns/f
|
||||
fastfloat (32) : 123.21 MB/s (+/- 1.2 %) 16.78 Mfloat/s 59.58 ns/f
|
||||
UTF-16 volume = 1.07202 MB
|
||||
fastfloat (64) : 259.51 MB/s (+/- 1.7 %) 17.68 Mfloat/s 56.57 ns/f
|
||||
fastfloat (32) : 244.28 MB/s (+/- 2.0 %) 16.64 Mfloat/s 60.10 ns/f
|
||||
*/
|
||||
|
||||
|
||||
#if defined(__linux__) || (__APPLE__ && __aarch64__)
|
||||
#define USING_COUNTERS
|
||||
@ -39,28 +86,25 @@ Value findmax_fastfloat(std::vector<std::basic_string<CharT>> &s,
|
||||
) {
|
||||
Value answer = 0;
|
||||
Value x = 0;
|
||||
for (auto &st : s) {
|
||||
|
||||
#ifdef USING_COUNTERS
|
||||
collector.start();
|
||||
#else
|
||||
t1 = std::chrono::high_resolution_clock::now();
|
||||
#endif
|
||||
|
||||
for (auto &st : s) {
|
||||
auto [p, ec] = fast_float::from_chars(st.data(), st.data() + st.size(), x);
|
||||
|
||||
#ifdef USING_COUNTERS
|
||||
aggregate.push_back(collector.end());
|
||||
#else
|
||||
t2 = std::chrono::high_resolution_clock::now();
|
||||
time += t2 - t1;
|
||||
#endif
|
||||
|
||||
if (ec != std::errc{}) {
|
||||
throw std::runtime_error("bug in findmax_fastfloat");
|
||||
}
|
||||
answer = answer > x ? answer : x;
|
||||
}
|
||||
#ifdef USING_COUNTERS
|
||||
aggregate.push_back(collector.end());
|
||||
#else
|
||||
t2 = std::chrono::high_resolution_clock::now();
|
||||
time += t2 - t1;
|
||||
#endif
|
||||
return answer;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user