Making Android WebView 2.5× Faster (And Proving It with Data)
Article Summary
Timur Borgalinov from Uzum Market turned Android WebView from a performance black hole into a predictable, measurable component. His team achieved 2.5× faster load times with data to prove it.
WebView screens are notorious for unpredictable performance: sometimes instant, sometimes a 5-second white screen. Borgalinov's team built a complete measurement and optimization pipeline around WebView prerendering, visual readiness detection, and automated metrics collection.
Key Takeaways
- Built WebViewPreloader service that warms up and prerenders pages in background
- Created WebViewReadyDetector using bitmap analysis to measure actual visual readiness
- Achieved 2.5× faster load times for slowest 10% of users with measurable data
- Saved 2,800 user hours monthly on 5M screen opens through prerendering
- Used hybrid strategy: prerenderUrlAsync API with fallback to invisible WebView
The team transformed WebView from an unmeasurable black box into a performance-managed component with clear metrics, saving thousands of user hours and improving conversion rates.
About This Article
Android WebView takes a long time to initialize, especially the first time it runs. Developers can't easily tell when users actually see content on screen. onPageFinished() either fires too early or too late, making it hard to figure out if slowdowns come from the network, backend, frontend, or Chromium itself.
Borgalinov's team created WebViewReadyDetector, which renders the WebView offscreen as a small bitmap and watches for non-white pixels to cross a 2% threshold across multiple frames. This gives a concrete TIME_TO_VISUAL_READY_MS metric that doesn't depend on onPageFinished() timing.
Using a hybrid prerendering strategy with prerenderUrlAsync and an invisible WebView fallback cut load times by 2.5x for the slowest 10% of users. Across 5 million screen opens in their payment and onboarding flows, this saved about 2,800 hours of user attention per month.