1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
ripgrep/crates/printer
Andrew Gallant 1659fb9b43 printer: hand-roll decimal formatting
It seems like a trifle, but if the match frequency is high enough, the
allocation+formatting of line numbers (and columns and byte offsets)
starts to matter. We squash that part of the profile in this commit by
doing our own decimal formatting. I speculate that we get a speed-up
from this by avoiding the formatting machinery and also a possible
allocation.

An alternative would be to use the `itoa` crate, and it is indeed
marginally faster in ad hoc benchmarks, but I'm satisfied enough with
this solution.
2023-10-09 20:29:52 -04:00
..
src printer: hand-roll decimal formatting 2023-10-09 20:29:52 -04:00
Cargo.toml hyperlink: rejigger how hyperlinks work 2023-09-25 14:39:54 -04:00
LICENSE-MIT repo: move all source code in crates directory 2020-02-17 19:24:53 -05:00
README.md edition: manual changes 2021-06-01 21:07:37 -04:00
UNLICENSE repo: move all source code in crates directory 2020-02-17 19:24:53 -05:00

grep-printer

Print results from line oriented searching in a human readable, aggregate or JSON Lines format.

Build status

Dual-licensed under MIT or the UNLICENSE.

Documentation

https://docs.rs/grep-printer

NOTE: You probably don't want to use this crate directly. Instead, you should prefer the facade defined in the grep crate.

Usage

Add this to your Cargo.toml:

[dependencies]
grep-printer = "0.1"