uap-rs icon indicating copy to clipboard operation
uap-rs copied to clipboard

Switch to or support `regex-lite`

Open Dav1dde opened this issue 6 months ago • 1 comments

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 to regex-lite. Which means the regex dependency can't be fully replaced.

What would be your preferred approach?. I have a these proposals:

  1. Add 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 either regex or regex-lite).
  2. Drop unicode support and switch fully to regex-lite
  3. Do nothing

What are your thoughts?

Dav1dde avatar Aug 14 '24 08:08 Dav1dde