qpdb / mentat

A persistent, relational store inspired by Datomic and DataScript.
https://mentat.rs/
Apache License 2.0
52 stars 2 forks source link

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

Open gburd opened 4 years ago

gburd commented 4 years ago

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

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

thomcc commented 4 years ago

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).