itoa
Fast function for printing integer primitives to a decimal string (by dtolnay)
rust-fnv
Fowler–Noll–Vo hash function (by servo)
itoa | rust-fnv | |
---|---|---|
2 | 2 | |
278 | 325 | |
- | 1.2% | |
6.8 | 5.1 | |
16 days ago | about 2 months ago | |
Rust | Rust | |
Apache License 2.0 | Apache License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
itoa
Posts with mentions or reviews of itoa.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-01-13.
-
Potential problem with the package manager
The hyper package for the crab language actually has a dependency on a package that does itoa (among others) so IMO the problem exist there too and most non trivial packages will be bloated
-
Debian discusses vendoring again
I see itoa which seems trivial on the surface. The implementation is highly optimized, but it's also covering all the different cases. I'm guessing this is for printing match counts or line numbers, and if this is actually a bottleneck for ripgrep — which seems unlikely — then maybe it's worth it. You know your own needs, and if it was a bottleneck, I bet you could do just as well, if not better, with a custom, smaller, simpler solution inside ripgrep. (i.e. just make sure the power-of-ten denominators are available at compile time so the compiler won't generate divisions.)
rust-fnv
Posts with mentions or reviews of rust-fnv.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-08-01.
-
How to write slow Rust code. My battle to beat Common Lisp and Java on a phone number encoding problem.
Use faster hashing function (e.g. fnv, there are other potentially faster options as well). By default Rust std uses a DoS-resistant function, which is relatively slow.
-
Debian discusses vendoring again
Looking at ripgrep myself, I'm seeing some trivial dependencies. One is fnv. Perhaps you're not aware, but FNV-1a is literally ~4 lines of code. It's about as sophisticated as left-pad. I've written it from scratch a dozen times off the top of my head (the official offset basis and prime are really not special, so you can just generate your own). It would take you about a minute to eliminate it.
What are some alternatives?
When comparing itoa and rust-fnv you can also consider the following projects:
perl5 - 🐪 The Perl programming language
getopt - POSIX getopt() as a portable header library
fst - Represent large sets and maps compactly with finite state transducers.
optparse - Portable, reentrant, getopt-like option parser
ucd-generate - A command line tool to generate Unicode tables as source code.
pre-commit - A framework for managing and maintaining multi-language pre-commit hooks.
unicode-xid
rust-base64 - base64, in rust
nixpkgs - Nix Packages collection & NixOS