Skip to content

Commit

Permalink
subscriber: disable regex dependency default features (#899)
Browse files Browse the repository at this point in the history
The regex dependency is used only to parse configuration directives, and
therefore is not performance critical.  This change turns off all default
features (except 'std') from regex in order to optimize for compile times for
this non-performance-critical code.

Note that due to the presence of the 'criterion' dependency (which has its own
default-features dependency on regex), the tests do not normally run with only
the minimal set of regex features. I did remove the criterion dependency to
verify that tests build, but I'm not sure how to test that we're not using
disabled regex features on an ongoing basis.

Co-authored-by: Bryan Donlan <bdonlan@amazon.com>
  • Loading branch information
bdonlan and Bryan Donlan committed Aug 7, 2020
1 parent 9ae4676 commit 7f24283
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tracing-subscriber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tracing-core = { path = "../tracing-core", version = "0.1.12" }

# only required by the filter feature
matchers = { optional = true, version = "0.0.1" }
regex = { optional = true, version = "1" }
regex = { optional = true, version = "1", default-features = false, features = ["std"] }
smallvec = { optional = true, version = "1" }
lazy_static = { optional = true, version = "1" }

Expand All @@ -60,7 +60,7 @@ tracing = { path = "../tracing", version = "0.1"}
log = "0.4"
tracing-log = { path = "../tracing-log", version = "0.1" }
criterion = { version = "0.3", default_features = false }
regex = "1"
regex = { version = "1", default-features = false, features = ["std"] }

[badges]
maintenance = { status = "experimental" }
Expand Down

0 comments on commit 7f24283

Please sign in to comment.