Skip to content

WebView2 performance optimization: Seeking best practices for flag usage in real-world browser app #5321

@nirdil

Description

@nirdil

Hi everyone,

I've been doing deep performance profiling using the BrowserBench Speedometer benchmark.

To explore tuning options, I tested a variety of WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS, including:

--disable-features=msSmartScreenProtection,msWebView2EnableTrackingPrevention,msWebView2EnableShoppingFeatures,msWebView2EnableFamilySafety
--disable-background-timer-throttling
--disable-renderer-backgrounding
--disable-backgrounding-occluded-windows
--no-first-run
--msWebView2CodeCache
--js-flags=--scavenger_max_new_space_capacity_mb=8

However, Speedometer scores remain largely unchanged, even in isolated test environments. Would appreciate guidance on whether this is the right approach, or if there's anything else I could try to improve runtime performance in this context.

Would appreciate these clarifications:

  1. Which of these flags are actually respected in WebView2 (specifically in WinUI 2 vs. WinUI 3), and are there any additional relevant Microsoft-specific flags?
  2. Are msSmartScreenProtection and msWebView2EnableTrackingPrevention considered officially supported flags to disable for scenarios like incognito browsing or performance tuning?
  3. Are there any additional WebView2-specific settings or APIs or DevToolProtocol commands, beyond startup flags, that are recommend for improving Speedometer scores?

Thanks,
--Niro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions