As suggested by @epage[1].
Ad hoc timings on my i7-12900K:
before cargo build: 4.91s
before cargo build release: 8.05s
after cargo build: 4.69s
after cargo build release: 7.83s
... pretty underwhelming if you ask me. Ah well. And on my M2 mac mini:
before cargo build: 6.18s
before cargo build release: 14.50s
after cargo build: 5.52s
after cargo build release: 13.44s
Still kind of underwhelming, but definitely better. It shaves a full
second off of compile times in release mode. I went back to my
i7-12900K, but passed `-j1` to `cargo build` to force single threaded
mode:
before cargo build: 19.44s
before cargo build release: 50.64s
after cargo build: 16.76s
after cargo build release: 48.00s
Which seems pretty consistent with the modest improvements above.
Looking at `cargo build --timings`, the beefiest chunk of time is spent
in compiling `regex-automata`, by far. This is fine because it's core
functionality. I wish a fast general purpose regex engine with its
internals exposed as a separately versioned library didn't require so
much code... Blech.
[1]: https://old.reddit.com/r/rust/comments/17rd8ww/faster_compilation_with_the_parallel_frontend_in/k8igjlg/
45 lines
1.5 KiB
TOML
45 lines
1.5 KiB
TOML
[package]
|
|
name = "grep-printer"
|
|
version = "0.1.7" #:version
|
|
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
|
description = """
|
|
An implementation of the grep crate's Sink trait that provides standard
|
|
printing of search results, similar to grep itself.
|
|
"""
|
|
documentation = "https://docs.rs/grep-printer"
|
|
homepage = "https://github.com/BurntSushi/ripgrep/tree/master/crates/printer"
|
|
repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/printer"
|
|
readme = "README.md"
|
|
keywords = ["grep", "pattern", "print", "printer", "sink"]
|
|
license = "Unlicense OR MIT"
|
|
edition = "2021"
|
|
|
|
[features]
|
|
default = ["serde"]
|
|
serde = ["dep:base64", "dep:serde", "dep:serde_json"]
|
|
|
|
[dependencies]
|
|
base64 = { version = "0.21.4", optional = true }
|
|
bstr = "1.6.2"
|
|
grep-matcher = { version = "0.1.6", path = "../matcher" }
|
|
grep-searcher = { version = "0.1.11", path = "../searcher" }
|
|
log = "0.4.5"
|
|
termcolor = "1.3.0"
|
|
serde = { version = "1.0.193", optional = true }
|
|
serde_json = { version = "1.0.107", optional = true }
|
|
|
|
[dev-dependencies]
|
|
grep-regex = { version = "0.1.11", path = "../regex" }
|
|
|
|
[package.metadata.docs.rs]
|
|
# We want to document all features.
|
|
all-features = true
|
|
# This opts into a nightly unstable option to show the features that need to be
|
|
# enabled for public API items. To do that, we set 'docsrs', and when that's
|
|
# enabled, we enable the 'doc_auto_cfg' feature.
|
|
#
|
|
# To test this locally, run:
|
|
#
|
|
# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
|
|
rustdoc-args = ["--cfg", "docsrs"]
|