mahkoh/uapi

Remove Regex dependency?

e00E opened this issue · 2 comments

e00E commented

It feels heavy to transitively depend on the regex crate for a wrapper around the system c library.
I see that regex is only used in two places. Maybe those could be replaced with more manual parsing. On the other hand it also looks like regex is only used at build time and should not end up in the final binary (right?) so maybe this fine.

Regex is only used at compile time. I don't know if the compile time is significant enough to warrant removing it.

e00E commented

An alternative is to use minimal features. Currently uapi could depend on regex without the perf feature (see https://docs.rs/regex/1.4.2/regex/#ecosystem-features):

regex = { version = "1", default-features = false, features = ["std", "unicode"] }

On my machine compile times for building uapi are (cargo clean && time cargo build --release):

  • minimal features 1 thread: 25.05
  • all features 1 thread: 29.68
  • minimal features 15 threads: 4.56
  • all features 15 thread: 5.12

I didn't evaluate not using regex at all. Based on this test I feel that it is a significant improvement.
Thanks for making this crate btw.