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

PM-14255: Remove accessibility logic to improve overall performance #4206

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

david-livefront
Copy link
Collaborator

🎟️ Tracking

PM-14255

📔 Objective

This PR makes two major performance improvements for the accessibility service.

  • Remove the typeWindowContentChanged event type which occurs much more frequently than needed.
  • Remove the usage of the RootInActiveWindow which can take a long time to access.

📸 Screenshots

Before After
before.mp4
after.mp4

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

SaintPatrck
SaintPatrck previously approved these changes Oct 30, 2024
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@a0b9e92). Learn more about missing BASE report.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4206   +/-   ##
=======================================
  Coverage        ?   89.05%           
=======================================
  Files           ?      445           
  Lines           ?    38645           
  Branches        ?     5403           
=======================================
  Hits            ?    34414           
  Misses          ?     2357           
  Partials        ?     1874           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -22,8 +22,7 @@ class BitwardenAccessibilityService : AccessibilityService() {
lateinit var processor: BitwardenAccessibilityProcessor

override fun onAccessibilityEvent(event: AccessibilityEvent) {
if (rootInActiveWindow?.packageName != event.packageName) return
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fedemkr & @mpbw2

Do you know how important the package name check is?
I have not seen it do anything in my testing but this check existed in the Maui app and I wanted to make sure it was OK to remove.

Copy link
Collaborator Author

@david-livefront david-livefront Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I left the check in but reduced our calls to rootInActiveWindow down to one. This should still have a positive impact on performance without losing the package check.

@david-livefront david-livefront force-pushed the PM-14255-accessibility-performance branch from ac10fcf to 947a93d Compare October 31, 2024 17:38
@david-livefront
Copy link
Collaborator Author

Thanks @SaintPatrck

@david-livefront david-livefront added this pull request to the merge queue Oct 31, 2024
Merged via the queue into main with commit 4831750 Oct 31, 2024
9 checks passed
@david-livefront david-livefront deleted the PM-14255-accessibility-performance branch October 31, 2024 18:30
SaintPatrck pushed a commit that referenced this pull request Nov 1, 2024
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