Skip to content

perf: serialize {u,i}i128 via itoa#401

Merged
BurntSushi merged 1 commit intoBurntSushi:masterfrom
paolobarbolini:serialize-u128-via-itoa
Aug 18, 2025
Merged

perf: serialize {u,i}i128 via itoa#401
BurntSushi merged 1 commit intoBurntSushi:masterfrom
paolobarbolini:serialize-u128-via-itoa

Conversation

@paolobarbolini
Copy link
Contributor

@paolobarbolini paolobarbolini commented Aug 17, 2025

This optimizes the serialize_i128 and serialize_u128 implementations by having them use itoa, as all of the other integer implementations do. This avoids going through the Display implementation of u128/i128 and an intermediate allocation, which is necessary because of how collect_str is currently implemented.

The current implementation seems to be a remnant of the pre-1.0 itoa days, which didn't support u128 and i128.

@BurntSushi BurntSushi merged commit 633552a into BurntSushi:master Aug 18, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants