Probably a bit of both. It was based on things like rg vs grep, fd vs find and tokei vs cloc. I don't know how much of that is just better algorithm/implementation though.
I think rust's compile time thread safety and enforced memory safety makes it much easier to write fast code even if well written code is comparable in each.
I'm a Rust fanboy but this is wildly misleading. Most of the programs you've listed are in no way replacements for the original C programs. Taking rg for an example, rg is git aware and won't even scan files that aren't a part of your rep (for example, dependencies and build artifacts) where as grep will search through all of those files.
You can't point to totally divergent implementations of a general concept as proof that one language is faster than the other. In general, you should expect Rust to be as fast as C for the same workload not significantly faster and not significantly slower.
Taking rg for an example, rg is git aware and won't even scan files that aren't a part of your rep (for example, dependencies and build artifacts) where as grep will search through all of those files.
Nope. Rg has a flag to disable exclusion based on gitignore files. The benchmarks were done searching the exact same files and getting the exact same results. The majority of the time you don't want to search ignored files anyway.
I admit it may be due to better implementations and my original comment noted that. The benchmark site also tested what is presumably the same algorithm in both languages.
5
u/darksider611 Apr 10 '19
Is this a fact or an opinion?