Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(ua): Disables unicode support in user agent parser #3929

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

Dav1dde
Copy link
Member

@Dav1dde Dav1dde commented Aug 14, 2024

Disables unicode support for the user agent regexes, this is generally safe to do as the library puts it:

    /// Enable or disable unicode support. This is enabled by default.
    /// Unicode regexes are much more complex and take up more memory.
    /// Most uaparser implementation do not support unicode, so disabling
    /// this is generally safe to do.

It saves a lot of memory:

used memory `uaparser_no_unicode()`: peak: 28.38 MiB | total: 169.18 MiB | current: 28.32 MiB
used memory `uaparser()`: peak: 165.05 MiB | total: 1.10 GiB | current: 164.80 MiB

And using the parser with 10 threads:

used memory `uaparser_used(false)`: peak: 109.06 MiB | total: 254.88 MiB | current: 109.06 MiB
used memory `uaparser_used(true)`: peak: 519.80 MiB | total: 1.46 GiB | current: 519.71 MiB

@Dav1dde Dav1dde requested a review from a team as a code owner August 14, 2024 06:28
@Dav1dde Dav1dde self-assigned this Aug 14, 2024
@Dav1dde Dav1dde merged commit c782383 into master Aug 14, 2024
26 checks passed
@Dav1dde Dav1dde deleted the dav1d/ua-no-unicode branch August 14, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants