Commit Graph

8 Commits

Author SHA1 Message Date
JCrawfy
ee593c2673 bug fixes, move the faster serialisation into the numeric header
serialisation ends up roughly 2x improvement going from sstream to snprintf

Run on (4 X 3500 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 262K (x4)
  L3 Unified 6291K (x1)
-------------------------------------------------------------------------------------------------------------
Benchmark                                                                   Time             CPU   Iterations
-------------------------------------------------------------------------------------------------------------
RandFloatStrs/double_from_string_sstream                                  968 ns          977 ns       640000
RandFloatStrs/double_from_string_strtod                                   272 ns          270 ns      2488889
RandFloatStrs/double_from_string_strtod_fixed                             272 ns          270 ns      2488889
RandFloatStrs/double_from_string_strtod_fixed_const_ref                   273 ns          270 ns      2488889
RandFloatStrs/double_from_string_std_from_chars                           193 ns          195 ns      3446154
RandFloatCommaStrs/double_from_string_strtod_fixed_comma_ref              272 ns          273 ns      2635294
RandFloatCommaStrs/double_from_string_strtod_fixed_comma_const_ref        276 ns          273 ns      2635294
RandFloats/string_from_double_sstream                                    1311 ns         1318 ns       497778
RandFloats/string_from_double_sstream_cached                             1076 ns         1050 ns       640000
RandFloats/string_from_double_snprintf                                    601 ns          600 ns      1120000
RandFloats/string_from_double_snprintf_fixed                              600 ns          600 ns      1120000
RandFloats/string_from_double_std_to_chars                                117 ns          117 ns      5600000
RandFloatsComma/string_from_double_snprintf_fixed_comma                   600 ns          600 ns      1120000
2020-03-01 22:01:14 +13:00
Thomas Fussell
e8ee585897
bump copyright year to 2020 2020-02-08 12:12:59 -05:00
JCrawfy
2eb88c23d6 move numeric utils into the public headers
resolves #398
2019-11-18 19:25:02 +13:00
Crzyrndm
e183e37ae6 remove roundoff test, add test for exponential representations
-- testing that a number with >15 significant digits rounded off to 15 failed on all tested platforms
2018-08-25 14:06:20 +12:00
Crzyrndm
1003ba507d Add a test for serialize_number_to_string
-- should allow serialisation of up to 15 significant digits
-- don't use default stringstreams, typically only get ~6 significant digits
2018-08-25 13:54:54 +12:00
Crzyrndm
875f143d74 fix parameter ordering inconsistency that could cause switching the parameters to give different results 2018-08-25 13:31:16 +12:00
Crzyrndm
4188d35caf Add tests for the other small utilities 2018-08-19 15:11:57 +12:00
Crzyrndm
9565377963 Adding tests for xlnt::detail::float_equals
-- Plenty of comments which should be useful if it becomes useful to tweak the comparison
2018-08-19 14:41:00 +12:00