why is binary size still large after disabling unicode? #790
-
I have noticed in an application I am working on which gets compiled to WebAssembly that the binary size increases by quite some amount (150 KB). I find this a lot and was wondering if this is normal in terms of the regex engine without unicode support. So basically I have disabled all default features and have re-enabled |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
See: #583 See: #613 I don't know whether it's "normal." All regex engines that I think of as "fast" have a boatload of code in them. A slower or less featureful regex engine could likely be implemented in much less code.
Well, If you don't need Unicode and your regexes are known statically, then you could also use |
Beta Was this translation helpful? Give feedback.
-
I imagine, alternatively, if you're targeting Web environment with your Wasm, then you could conditionally compile to UPD and, of course, also watch out for speed overhead if you're going to convert large strings from Rust to pass to the regex when using this technique. However, if your data comes as an input from JS, then conversion can be avoided altogether. |
Beta Was this translation helpful? Give feedback.
See: #583
See: #613
I don't know whether it's "normal." All regex engines that I think of as "fast" have a boatload of code in them. A slower or less featureful regex engine could likely be implemented in much less code.
Well,
perf
adds to the binary size and the number of dependencies. If you care most about binary size, then disableperf
.If you don't need Unicode and your regexes are known statically, then you could also use
regex-automata
to embed a DFA into your binary.