tealdeer-rs / tealdeer

A very fast implementation of tldr in Rust.
https://tealdeer-rs.github.io/tealdeer/
Apache License 2.0
4.17k stars 123 forks source link

Use unbuffered I/O for faster printing to stdout, switch to Rustls #187

Closed sondr3 closed 3 years ago

sondr3 commented 3 years ago

Compared to the benchmark in #129 from the first post (ran hyperfine --prepare 'sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' './target/release/tldr tar'). I don't know the exact command that the author of outfieldr ran, but you can also see a comparison I posted there.

Benchmark #1: ./target/release/tldr tar
  Time (mean ± σ):      29.3 ms ±   6.2 ms    [User: 1.7 ms, System: 4.3 ms]
  Range (min … max):    24.3 ms …  50.1 ms    22 runs
sondr3 commented 3 years ago

Updated according to the reviews, I'm on a different computer so can't run the benchmark again but there shouldn't be a difference.

sondr3 commented 3 years ago

I actually started converting the unwraps to proper errors, but figured it was out of the scope of this PR. Happy to fix though, it may take a few days as we are celebrating our Independence Day tomorrow 😄

sondr3 commented 3 years ago

I think I managed to fix the requested changes, this is ready for another round of reviews.

sondr3 commented 3 years ago

Done :smiley:

dbrgn commented 3 years ago

Thanks for the first round of reviews, @niklasmohrin. I'll try to take a look this weekend!