[SERVER-54289] Use std::to_chars in DecimalCounter Created: 04/Feb/21 Updated: 14/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Gregory Noma | Assignee: | Backlog - Storage Execution Team |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Storage Execution
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
When constructing a DecimalCounter starting at a nonzero value, currently we use our custom ItoA to parse the number into a string. It may be a bit cleaner to instead use std::to_chars. In
|
| Comments |
| Comment by Alex Neben [ 14/Dec/22 ] |
|
FYI: v4 toolchain just merged so this should be unblocked. |
| Comment by Gregory Noma [ 02/Sep/22 ] |
|
std::to_chars should be fast; part of the work here is to compare its performance with the current implementation. There is already a microbenchmark for this. |
| Comment by Geert Bosch [ 02/Sep/22 ] |
|
What is the point of this change? It's only a single-time memcpy, which should be fine for perf. Typically any standard library string formatting is very slow. |