Skip to content

Optimize integer to_chars with division by 100#6007

Merged
StephanTLavavej merged 12 commits into
microsoft:mainfrom
AlexGuteniev:the-other-itoa
Mar 4, 2026
Merged

Optimize integer to_chars with division by 100#6007
StephanTLavavej merged 12 commits into
microsoft:mainfrom
AlexGuteniev:the-other-itoa

Conversation

@AlexGuteniev
Copy link
Copy Markdown
Contributor

@AlexGuteniev AlexGuteniev commented Jan 11, 2026

Keep repeating that part, as inlining fails

@AlexGuteniev AlexGuteniev requested a review from a team as a code owner January 11, 2026 09:46
@github-project-automation github-project-automation Bot moved this to Initial Review in STL Code Reviews Jan 11, 2026
@StephanTLavavej StephanTLavavej added the performance Must go faster label Jan 11, 2026
Comment thread stl/inc/charconv Outdated
@github-project-automation github-project-automation Bot moved this from Initial Review to Work In Progress in STL Code Reviews Mar 3, 2026
Comment thread benchmarks/src/integer_to_string.cpp Outdated
Comment thread benchmarks/src/integer_to_string.cpp Outdated
@StephanTLavavej
Copy link
Copy Markdown
Member

Thanks! 😻 After fixing the bug that was invalidating the benchmark, my 5950X results are good:

Benchmark Before After Speedup
integer_to_chars<uint8_t, 2.5, 1.5> 6.48 ns 6.23 ns 1.04
integer_to_chars<uint16_t, 5.0, 3.0> 7.56 ns 6.90 ns 1.10
integer_to_chars<uint32_t, 10.0, 6.0> 9.50 ns 8.30 ns 1.14
integer_to_chars<uint64_t, 20.0, 12.0> 12.5 ns 9.37 ns 1.33

@StephanTLavavej StephanTLavavej moved this from Work In Progress to Ready To Merge in STL Code Reviews Mar 3, 2026
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Mar 3, 2026
@StephanTLavavej
Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo. Please notify me if any further changes are pushed, otherwise no action is required.

@StephanTLavavej StephanTLavavej merged commit 1877461 into microsoft:main Mar 4, 2026
49 checks passed
@github-project-automation github-project-automation Bot moved this from Merging to Done in STL Code Reviews Mar 4, 2026
@StephanTLavavej
Copy link
Copy Markdown
Member

Thanks for improving my favorite function! 🎉 🚀 🐈

@AlexGuteniev AlexGuteniev deleted the the-other-itoa branch March 4, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Must go faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants