Converting an Integer to a Decimal String in Under Two Nanoseconds.

Saved in:
Bibliographic Details
Title: Converting an Integer to a Decimal String in Under Two Nanoseconds.
Authors: Champagne Gareau, Jaël1 (AUTHOR), Lemire, Daniel1 (AUTHOR) daniel.lemire@teluq.ca
Source: Software: Practice & Experience. Aug2026, Vol. 56 Issue 8, p963-977. 15p.
Subjects: Algorithms, Data conversion, Parallel processing, AMD microprocessors
Abstract: Objective: Converting binary integers to variable‐length decimal strings is a fundamental operation in computing. Conventional fast approaches rely on recursive division and small lookup tables. The goal of this work is to develop a significantly faster method for this task. Methods: We propose a SIMD‐based algorithm that leverages integer multiply‐add instructions available on recent AMD and Intel processors. Our method eliminates lookup tables entirely and computes multiple quotients and remainders in parallel. Additionally, we introduce a dual‐variant design with dynamic selection that adapts to input characteristics: a branch‐heavy variant optimized for homogeneous digit‐length distributions and a branch‐light variant for heterogeneous datasets. Results: Our single‐core algorithm consistently outperforms all competing methods across the full range of integer sizes. It runs 1.4–2× faster than the closest competitor and 2–4× faster than the C++ standard library function 'std::to_chars' across tested workloads. Conclusion: The proposed SIMD‐based approach with dual‐variant dynamic selection provides a substantial performance improvement for integer‐to‐decimal conversion, delivering superior speed without relying on traditional lookup tables. [ABSTRACT FROM AUTHOR]
Copyright of Software: Practice & Experience is the property of Wiley-Blackwell and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)
Database: Engineering Source
FullText Text:
  Availability: 0
Header DbId: egs
DbLabel: Engineering Source
An: 195096160
AccessLevel: 6
PubType: Academic Journal
PubTypeId: academicJournal
PreciseRelevancyScore: 0
IllustrationInfo
Items – Name: Title
  Label: Title
  Group: Ti
  Data: Converting an Integer to a Decimal String in Under Two Nanoseconds.
– Name: Author
  Label: Authors
  Group: Au
  Data: <searchLink fieldCode="AR" term="%22Champagne+Gareau%2C+Jaël%22">Champagne Gareau, Jaël</searchLink><relatesTo>1</relatesTo> (AUTHOR)<br /><searchLink fieldCode="AR" term="%22Lemire%2C+Daniel%22">Lemire, Daniel</searchLink><relatesTo>1</relatesTo> (AUTHOR)<i> daniel.lemire@teluq.ca</i>
– Name: TitleSource
  Label: Source
  Group: Src
  Data: <searchLink fieldCode="JN" term="%22Software%3A+Practice+%26+Experience%22">Software: Practice & Experience</searchLink>. Aug2026, Vol. 56 Issue 8, p963-977. 15p.
– Name: Subject
  Label: Subjects
  Group: Su
  Data: <searchLink fieldCode="DE" term="%22Algorithms%22">Algorithms</searchLink><br /><searchLink fieldCode="DE" term="%22Data+conversion%22">Data conversion</searchLink><br /><searchLink fieldCode="DE" term="%22Parallel+processing%22">Parallel processing</searchLink><br /><searchLink fieldCode="DE" term="%22AMD+microprocessors%22">AMD microprocessors</searchLink>
– Name: Abstract
  Label: Abstract
  Group: Ab
  Data: Objective: Converting binary integers to variable‐length decimal strings is a fundamental operation in computing. Conventional fast approaches rely on recursive division and small lookup tables. The goal of this work is to develop a significantly faster method for this task. Methods: We propose a SIMD‐based algorithm that leverages integer multiply‐add instructions available on recent AMD and Intel processors. Our method eliminates lookup tables entirely and computes multiple quotients and remainders in parallel. Additionally, we introduce a dual‐variant design with dynamic selection that adapts to input characteristics: a branch‐heavy variant optimized for homogeneous digit‐length distributions and a branch‐light variant for heterogeneous datasets. Results: Our single‐core algorithm consistently outperforms all competing methods across the full range of integer sizes. It runs 1.4–2× faster than the closest competitor and 2–4× faster than the C++ standard library function 'std::to_chars' across tested workloads. Conclusion: The proposed SIMD‐based approach with dual‐variant dynamic selection provides a substantial performance improvement for integer‐to‐decimal conversion, delivering superior speed without relying on traditional lookup tables. [ABSTRACT FROM AUTHOR]
– Name: AbstractSuppliedCopyright
  Label:
  Group: Ab
  Data: <i>Copyright of Software: Practice & Experience is the property of Wiley-Blackwell and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract.</i> (Copyright applies to all Abstracts.)
PLink https://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=egs&AN=195096160
RecordInfo BibRecord:
  BibEntity:
    Identifiers:
      – Type: doi
        Value: 10.1002/spe.70079
    Languages:
      – Code: eng
        Text: English
    PhysicalDescription:
      Pagination:
        PageCount: 15
        StartPage: 963
    Subjects:
      – SubjectFull: Algorithms
        Type: general
      – SubjectFull: Data conversion
        Type: general
      – SubjectFull: Parallel processing
        Type: general
      – SubjectFull: AMD microprocessors
        Type: general
    Titles:
      – TitleFull: Converting an Integer to a Decimal String in Under Two Nanoseconds.
        Type: main
  BibRelationships:
    HasContributorRelationships:
      – PersonEntity:
          Name:
            NameFull: Champagne Gareau, Jaël
      – PersonEntity:
          Name:
            NameFull: Lemire, Daniel
    IsPartOfRelationships:
      – BibEntity:
          Dates:
            – D: 01
              M: 08
              Text: Aug2026
              Type: published
              Y: 2026
          Identifiers:
            – Type: issn-print
              Value: 00380644
          Numbering:
            – Type: volume
              Value: 56
            – Type: issue
              Value: 8
          Titles:
            – TitleFull: Software: Practice & Experience
              Type: main
ResultId 1