Skip to content

perf: avoid Arc clones in root cert store paths and Safari emulator#150

Merged
deedy5 merged 2 commits into
mainfrom
dev
May 23, 2026
Merged

perf: avoid Arc clones in root cert store paths and Safari emulator#150
deedy5 merged 2 commits into
mainfrom
dev

Conversation

@deedy5
Copy link
Copy Markdown
Owner

@deedy5 deedy5 commented May 23, 2026

Two performance optimizations in builder hot paths:

  1. perf(safari): cache emulators per OS (primp)
    Split the OnceLock cache by BrowserEmulatorOS (iOS/macOS) so
    os_type is set at initialization time. This eliminates an
    Arc::make_mut deep clone on every build_safari_settings call.
  2. perf(reqwest): avoid deep clone of root cert store (primp-reqwest)
    Added default_root_store_arc() returning Arc<RootCertStore> so
    callers share the cached store via refcount increment instead of
    cloning the full certificate set.

deedy5 added 2 commits May 23, 2026 19:19
Add default_root_store_arc() returning Arc<RootCertStore> so callers
share the cached store via refcount instead of cloning the full set.
Split the cached BrowserEmulator by OS (iOS/macOS) so os_type is set
at initialization time. This avoids a deep clone on every
build_safari_settings call via Arc::make_mut.
@deedy5 deedy5 merged commit 34dd98c into main May 23, 2026
27 of 28 checks passed
@deedy5 deedy5 deleted the dev branch May 23, 2026 16:38
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.

1 participant