Big bump in code size with the switch to regex-automata in 1.9.0
glandium opened this issue · 2 comments
We recently upgraded regex from 1.7.1 to 1.9.4 in Firefox, and that led to a significant size increase (albeit, at the size of Firefox, it's almost a rounding error).
Here is what Bloaty McBloatFace has to say about the size of symbols containing "regex" in their name when using regex 1.8.4:
FILE SIZE VM SIZE
-------------- --------------
100.0% 1007Ki 100.0% 877Ki TOTAL
vs with regex 1.9.0:
FILE SIZE VM SIZE
-------------- --------------
100.0% 1.25Mi 100.0% 1.00Mi TOTAL
That's a 25% increase in size, assuming the vast majority of these symbols are from the regex* crates (and some do come from Firefox itself, e.g. js::frontend::TokenStreamSpecific<>::regexpLiteral()
, but they're on both ends. If anything, the more of these there are, the bigger the increase from regex* is).
I'm not sure I really follow what the desired action is here. The binary size increase is known and it's mentioned in the changelog: https://github.com/rust-lang/regex/blob/master/CHANGELOG.md#190-2023-07-05
This crate provides a wide array of options for tweaking the binary size at the expense of performance and/or functionality. You can even use an entirely different crate, as the changelog mentions, to swing as far as you can in favor of binary size (and compile times). It isn't clear which of these options you've tried and why they don't work for you.
Closing due to inactivity from the OP.