This is how I would make basic test app and that is added - I have no more time nor any interest to improve this further.
- Proper testing data distribution over whole range, or range of interest, instead of max 8 decimal digits.
- Proper testings excluding the best and the worst result and giving the mean of the rest. In real testing case I would add standard deviation information as well, better elapsed time resolution than ms, but it is anyway a bit better now...
- Possibility to compile and run on embedded systems.
- Added hamster_nz function (sorry, I missed it). Classical example, really fast with many optimization parameters.
- Brucehoult code is disabled, as it missing data pointer and returning pointer(similar to itoc). You may correct it accordingly and add it for testings if you wish.
- Janoc's function is adopted only to return null-terminator pointer in resulted string, in order to be identical to the proposed prototype function (faster writing new converted numbers).
Results are still similar:
O0:
itoc_sasa_1 : 2022.00ms Eliminated 2022, 2023 from 5 results
itoc_hamster_nz_1 : 2707.00ms Eliminated 2707, 2708 from 5 results
itoc_NorthGuy_1 : 2959.00ms Eliminated 2959, 2960 from 5 results
itoc_janoc_1 : 3591.00ms Eliminated 3591, 3592 from 5 results
O:
itoc_sasa_1 : 879.00ms Eliminated 878, 879 from 5 results
itoc_NorthGuy_1 : 1569.33ms Eliminated 1569, 1570 from 5 results
itoc_hamster_nz_1 : 1695.00ms Eliminated 1695, 1696 from 5 results
itoc_janoc_1 : 1820.67ms Eliminated 1820, 1823 from 5 results
O2:
itoc_sasa_1 : 888.00ms Eliminated 888, 888 from 5 results
itoc_janoc_1 : 1053.33ms Eliminated 1053, 1054 from 5 results
itoc_NorthGuy_1 : 1422.00ms Eliminated 1421, 1423 from 5 results
itoc_hamster_nz_1 : 1515.67ms Eliminated 1515, 1516 from 5 results
Os:
itoc_sasa_1 : 2175.33ms Eliminated 2175, 2177 from 5 results
itoc_hamster_nz_1 : 3052.00ms Eliminated 3052, 3052 from 5 results
itoc_janoc_1 : 3059.67ms Eliminated 3059, 3060 from 5 results
itoc_NorthGuy_1 : 3087.00ms Eliminated 3086, 3087 from 5 results
Ofast:
itoc_sasa_1 : 826.67ms Eliminated 826, 828 from 5 results
itoc_janoc_1 : 951.33ms Eliminated 951, 952 from 5 results
itoc_hamster_nz_1 : 1296.00ms Eliminated 1295, 1297 from 5 results
itoc_NorthGuy_1 : 1422.00ms Eliminated 1422, 1422 from 5 results