Faster integer formatting - James Anhalt (jeaiii)’s algorithm

This page summarizes the projects mentioned and recommended in the original post on /r/cpp

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • itoa-benchmark

    C++ integer-to-string conversion benchmark

  • I considered using this method in {fmt} and found that its drawback compared to some alternatives is that it doesn't give you the number of digits in advance which means that you end up doing a copy. So often an optimized version of countlut from https://github.com/miloyip/itoa-benchmark performs better.

  • itoa

    Fast integer to ascii / integer to string conversion

  • I know, I was just being lazy 😏. This is also why itoa_always_10_digits performs the best in the benchmark, while it is in fact horribly slow for realistic data. If you care, here is a benchmark with a more realistic data: https://github.com/jeaiii/itoa.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts