Open Dav1dde opened 2 months ago
It seems like the performance hit may not be desirable and is much more than I anticipated. It may still make sense as an opt-in for environments where the user wants to prioritize resources constraint environments, e.g. when unicode is disabled and the regex-lite
feature flag is enabled.
I haven't run the numbers yet for this crate, but I did for
ua-parser
which brings down memory consumption significantly.I was initially just going to PR the change, but since this crate supports full unicode and no unicode modes (is there a usecase for full unicode?), this is not as easy since
regex-lite
does not support unicode. So it would only be possible to switch the non-unicode codepath toregex-lite
. Which means theregex
dependency can't be fully replaced.What would be your preferred approach?. I have a these proposals:
regex-lite
with a feature flag and only enable it for the non-unicode codepath (might be quite unergonomic code wise since we'll end up with a wrapper type for the regex dispatching to eitherregex
orregex-lite
).regex-lite
What are your thoughts?