This crate offers even more rapid functions for formatting integers into decimal format compared to the itoa crate.
If you desire to convert intergers into a decimal format and store them in a
String
, Vec
or any other contiguous buffer, then this crate will be the
best choice.
For writing integers to a std::io::Write
or std::fmt::Write
, both the
itoa crate and the itoap
crate shows
nearly identical performance for certain types, although itoap
is generally
faster.
The underlying implementation is based on the sse2
algorithm from the
itoa-benchmark repository.
While the itoa
crate processes integers from the last digits, this
algorithm operates from first digits, enabling direct writing of integers
to the buffer. Consequently, itoap
outperforms itoa
due to the efficiency.
Benchmark program was executed under the following environment:
Hardware/Software | Version |
---|---|
CPU model name | Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz |
CPU micro architecture | Sky Lake |
Standard libc implementation | glibc 2.35.0 |
rustc | rustc 1.70.0-nightly (07e0e2ec2 2023-02-28) |
itoa
crate highly depends on the CPU architecture and libc implementation.
👤 Ryohei Machida
- Github: @Kogia-sima
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2014-2016 Milo Yip, 2020 Ryohei Machida.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator