Skip to content

Optimize integer to_chars with division by 100 - #6007

Merged
Stephan T. Lavavej (StephanTLavavej) merged 12 commits into
microsoft:mainfrom
AlexGuteniev:the-other-itoa
Mar 4, 2026
Merged

Optimize integer to_chars with division by 100#6007
Stephan T. Lavavej (StephanTLavavej) merged 12 commits into
microsoft:mainfrom
AlexGuteniev:the-other-itoa

Conversation

@AlexGuteniev

@AlexGuteniev Alex Guteniev (AlexGuteniev) commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

Keep repeating that part, as inlining fails

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 Stephan T. Lavavej (StephanTLavavej) moved this from Work In Progress to Ready To Merge in STL Code Reviews Mar 3, 2026
@StephanTLavavej Stephan T. Lavavej (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
Stephan T. Lavavej (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! 🎉 🚀 🐈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Must go faster

2 participants