[meta] Reduce dependencies and on-disk footprint #278

Open
opened 2020-08-06 16:57:46 +00:00 by gburd · 1 comment
gburd commented 2020-08-06 16:57:46 +00:00 (Migrated from github.com)

This is a meta ticket to track our on-disk footprint. We want to:

  • reduce our dependencies, including not requiring regex
  • graph our on-disk size after stripping, etc (perhaps using PerfHerder, if we can integrate against it from Travis CI/AppVeyor)

See also @thomcc's initial analysis at https://mail.mozilla.org/pipermail/sync-dev/2018-June/001661.html.

This is a meta ticket to track our on-disk footprint. We want to: - [ ] reduce our dependencies, including [not requiring `regex`](https://github.com/mozilla/mentat/issues/771) - [ ] graph our on-disk size after stripping, etc (perhaps using PerfHerder, if we can integrate against it from Travis CI/AppVeyor) See also @thomcc's initial analysis at https://mail.mozilla.org/pipermail/sync-dev/2018-June/001661.html.
thomcc commented 2020-08-06 18:33:07 +00:00 (Migrated from github.com)

FWIW this is probably a little less relevant for use cases other than what the was in the past. In particular, a big use case for us was on Android, and for small browsers like Firefox Lite (previously Rocket), Lockwise, ... These use cases more sensitive than average to both binary and on-disc size. If you aren't targeting those cases, it's probably not worth sweating to the same extent.

That said, reducing dependency count (and especially slow-to-build ones like regex) is likely to improve your build speed, so it's nice to do as a dev quality-of-life step. It's worth noting that regex is a lot smaller than it used to be (e.g. than it was in 2018), and for a lot of regexs you can reduce the size a lot by disabling things like unicode tables that aren't required by the regex you use -- the compiler can't see that something like Regex::new("[^a-zA-Z_0-9]") doesn't require unicode tables, but it's pretty clear to a human it doesn't. (That said, for that pattern regex is overkill, even if stripped down).

There are also paths forward if you end up needing full arbitrary regex support with unicode (e.g. one avenue for https://github.com/qpdb/mentat/issues/267). (Note that ucd-generate is the crate that produces the unicode tables regex bundles).

FWIW this is probably a little less relevant for use cases other than what the was in the past. In particular, a big use case for us was on Android, and for small browsers like Firefox Lite (previously Rocket), Lockwise, ... These use cases more sensitive than average to both binary and on-disc size. If you aren't targeting those cases, it's probably not worth sweating to the same extent. That said, reducing dependency count (and especially slow-to-build ones like `regex`) is likely to improve your build speed, so it's nice to do as a dev quality-of-life step. It's worth noting that `regex` is a lot smaller than it used to be (e.g. than it was in 2018), and for a lot of regexs you can reduce the size a lot by disabling things like unicode tables that aren't required by the regex you use -- the compiler can't see that something like `Regex::new("[^a-zA-Z_0-9]")` doesn't require unicode tables, but it's pretty clear to a human it doesn't. (That said, for that pattern `regex` is overkill, even if stripped down). There are also [paths](https://github.com/BurntSushi/ucd-generate/issues/33) [forward](https://github.com/BurntSushi/ucd-generate/pull/35) if you end up needing full arbitrary regex support with unicode (e.g. one avenue for https://github.com/qpdb/mentat/issues/267). (Note that ucd-generate is the crate that produces the unicode tables `regex` bundles).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#278
No description provided.