Add benchmark for hex string conversion performance#1236
Merged
trcrsired merged 7 commits intocppfastio:nextfrom Dec 19, 2025
Merged
Add benchmark for hex string conversion performance#1236trcrsired merged 7 commits intocppfastio:nextfrom
trcrsired merged 7 commits intocppfastio:nextfrom
Conversation
- Introduced a new benchmark file `atoi_vs_from_chars_hex.cc` to compare the performance of various hex string conversion methods, including `strtoul`, `std::from_chars`, `fast_io::char_digit_to_literal`, and `fast_float::from_chars`. - Updated `CMakeLists.txt` to include the new benchmark executable `benchmark.0022.from_chars_hex` and set appropriate include directories and compile features.
- Introduced a new function `make_fixed_digits_numbers_buffer` to generate fixed-width decimal number buffers for benchmarking. - Enhanced the main function to include benchmarks for various integer parsing methods (e.g., `std::atoi`, `std::from_chars`, `fast_io::char_digit_to_literal`, and `fast_float::from_chars`) on fixed-width decimal substrings. - Updated output to use `fast_io::perrln` for consistency in error reporting.
- Introduced a new function `make_fixed_hex_numbers_buffer` to generate fixed-width hexadecimal number buffers for benchmarking. - Enhanced the main function to include benchmarks for various integer parsing methods (e.g., `strtoul`, `std::from_chars`, `fast_io::char_digit_to_literal`, and `fast_float::from_chars`) on fixed-width hexadecimal substrings. - Updated output to use `fast_io::perrln` for consistency in error reporting.
Update atoi_vs_from_chars.cc
Collaborator
|
@trcrsired 合并 |
Collaborator
|
@trcrsired 合并 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
atoi_vs_from_chars_hex.ccto compare the performance of various hex string conversion methods, includingstrtoul,std::from_chars,fast_io::char_digit_to_literal, andfast_float::from_chars.CMakeLists.txtto include the new benchmark executablebenchmark.0022.from_chars_hexand set appropriate include directories and compile features.