Skip to content
프로젝트

소개

정수를 ASCII 또는 문자열로 빠르게 변환

기타 프로젝트

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
-1
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

itoa - Fast integer to ascii / integer to string conversion

windows

  • newest version: jeaiii_to_text.h
  • 0 dependency header only - as in absolutely no dependencies on ANY other headers
  • fast - fasted tested on vs2019 in x86 and x64 for all digit lengths, uniform random bits, and uniform random digit lengths (latest version is even 25% faster than before) using https://github.com/jeaiii/itoa-benchmark
  • small - simple code that produces good compiled code even in debug builds (no nested functions)
  • compiles on clang, msvc, and gcc as C++11 or later
  • written to specialize well based on integer type (size, signed, unsigned) and possible values determined at compile time
  • Thanks to Junekey Jeon for the great write-up here, providing better insight into more rigorous mathematical foundations which eliminated an unneeded addition, and renewing my interest into making an even faster version

Check it out vs. {fmt} on godbolt.org

Disclaimer: This is not a good way to benchmark. It's not very repeatable and google benchmark is compiled in debug, although fmt being mostly header is optimized and inlined well. The performance charts below are much more accurate.

-----------------------------------------------------
Benchmark           Time             CPU   Iterations
-----------------------------------------------------
BM_fmt           16.6 ns         10.5 ns     75504520
BM_jea           10.2 ns         4.13 ns    159688774

Click for interactive performance charts

The last column is uniform random length numbers from 1 to N digits - worst case for branch prediction based on number of digits

u32toa_chart

jeaiii vs. fmt

관련 프로젝트 살펴보기

불러오는 중…