firefox-ios icon indicating copy to clipboard operation
firefox-ios copied to clipboard

Refactor FXIOS-14403 - [Performance] - Eliminate redundant blur view updates during BVC dismissal

Open PARAIPAN9 opened this issue 4 weeks ago • 4 comments

:scroll: Tickets

Jira ticket Github issue

:bulb: Description

  • Performance profiling revealed that frequent calls to updateBlurViews were causing tab tray hangs during BVC dismissal. This PR eliminates unnecessary blur view updates during view controller transitions.

  • Root Cause: updateBlurViews was invoked repeatedly during BVC dismissal, creating performance bottlenecks.

  • As you can see, pretty bad hangs related to updateBlurViews method.

  • Solution: Introduced a shouldLayoutSubviews flag that prevents blur view updates during transitions:

  • When the tab tray button is tapped, viewDidLayoutSubviews was called approximately 2 times after viewWillDisappear.

  • Each call triggered updateBlurViews, which was unnecessary during the transition animation.

  • The new flag blocks these updates during BVC → Tab Tray transitions.

Hangs before these changes:

updateBlurViewsHang

Hangs with changes in this PR.

noUpdateBlurViewsHangs
  • No more hangs related to updateBlurViews method, only micro hangs left to solve during presenting/dismissal animations.

:pencil: Checklist

  • [x] I filled in the ticket numbers and a description of my work
  • [x] I updated the PR name to follow our PR naming guidelines
  • [x] I ensured unit tests pass and wrote tests for new code
  • [x] If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
  • [x] If adding telemetry, I read the data stewardship requirements and will request a data review
  • [x] If adding or modifying strings, I read the guidelines and will request a string review from l10n
  • [x] If needed, I updated documentation and added comments to complex code

PARAIPAN9 avatar Dec 10 '25 15:12 PARAIPAN9

Tested with these changes, did not see any regressions regarding translucency.

PARAIPAN9 avatar Dec 10 '25 15:12 PARAIPAN9

Messages
:book: Project coverage: 38.1%

🧹 Tidy commit

Just 1 file(s) touched. Thanks for keeping it clean and review-friendly!

💬 Description craftsman

Great PR description! Reviewers salute you 🫡

🦊 BrowserViewController Check

We’re tracking the size of BrowserViewController.swift to keep it healthy.

  • ✨ Change in file size: +16 lines

❌ Per-file test coverage gate

The following changed file(s) are below 35.0% coverage:

File Coverage Required
firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift 29.7% 35.0%

Client.app: Coverage: 37.28

File Coverage
BrowserViewController.swift 29.68% ⚠️

Generated by :no_entry_sign: Danger Swift against ccb71e7d530178b929f372d3acd4c0edcf31fc0f

mobiletest-ci-bot avatar Dec 10 '25 15:12 mobiletest-ci-bot

We should wrab all changes in a toolbarTranslucencyRefactor check.

thatswinnie avatar Dec 10 '25 15:12 thatswinnie

Ok, I will.

PARAIPAN9 avatar Dec 10 '25 16:12 PARAIPAN9

Closing... It is easier to fix some of the issues for isToolbarTranslucencyRefactorEnabled in a new PR.

PARAIPAN9 avatar Dec 16 '25 12:12 PARAIPAN9