Sep 03

Spirit.Qi numeric parsers are the fastest in the world of C++ and surpasses even hand-written low level parsers such as atoi and atof written in C. This is old news actually. The numeric parsers are highly optimised from the very start, when I started writing Spirit V2. The tests were written in 2009, yet are still very relevant now. Here are the benchmark results from the same tests I ran today on a Mac using Clang. The benchmark code is in Github (qi/workbench):

Integer tests

atoi_test:  4.7452590000 [s] {checksum: 213ce33a}
strtol_test: 4.5116520000 [s] {checksum: 213ce33a}
spirit_int_test: 1.4126110000 [s] {checksum: 213ce33a}

Double Tests

atof_test: 3.2435210000 [s] {checksum: 84a4f7d}
strtod_test: 3.1327660000 [s] {checksum: 84a4f7d}
spirit_double_test: 0.7237810000 [s] {checksum: 84a4f7d}

GD Star Rating
loading...
preload preload preload