Draft: PersistentDataModel: Using to_chars instead of sprintf
This version improves performance of these methods between 1.8x to 3x.
This takes some nice elegant code and makes it very ugly however. So I will leave it to @gemmeren to decide if they want to use it.
cc @smh
Proof of concept can be seen in this test code: https://cernbox.cern.ch/s/J8k346RKzyrTdch
Run on (24 X 3700.04 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x12)
L1 Instruction 32 KiB (x12)
L2 Unified 512 KiB (x12)
L3 Unified 32768 KiB (x1)
Load Average: 0.05, 0.05, 0.01
--------------------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------------------
BM_TokentoStringNEW 92.9 ns 92.9 ns 7553115
BM_TokentoStringOLD 205 ns 205 ns 3402696
BM_keyNew 71.0 ns 71.0 ns 9817658
BM_keyOLD 118 ns 118 ns 5911308
toStringNEW 62.3 ns 62.3 ns 11244709
toStringOLD 102 ns 102 ns 6849851
Edited by Adam Edward Barton