Commit 633552a
authored
perf: serialize 128-bit integers via
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`.
PR #401itoa
1 parent e9f06f4 commit 633552a
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
0 commit comments