After reading Chris Penner's article titled, "Beating C With 80 Lines of Haskell", I just couldn't help myself and decided to replicate the experiment using Rust.
First, the results using wc(1)
:
$ time wc enwik9
13147025 129394476 1000000000 enwik9
real 0m2.655s
user 0m2.440s
sys 0m0.199s
Next, using wc-rs
:
$ time ./target/release/wc-rs enwik9
13147025 129394476 1000000000 enwik9
real 0m2.212s
user 0m2.086s
sys 0m0.121s
I'm only using stdlib, and using only a single thread. Not too shabby.