Skip to content

ObserverManager: Optimize to reduce dictionary lookups#11067

Merged
ScarletKuro merged 1 commit intoMudBlazor:devfrom
ScarletKuro:observermanager_optimize
Mar 20, 2025
Merged

ObserverManager: Optimize to reduce dictionary lookups#11067
ScarletKuro merged 1 commit intoMudBlazor:devfrom
ScarletKuro:observermanager_optimize

Conversation

@ScarletKuro
Copy link
Member

@ScarletKuro ScarletKuro commented Mar 20, 2025

Description

Adds new TryGetOrAddSubscription method to avoid using IsSubscribed+Subscribe pattern which results in additional lookups.

How Has This Been Tested?

New unit tests, existing ones on the BrowserViewportService and KeyInterceptorService.

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added bug Unexpected behavior or functionality not working as intended PR: needs review labels Mar 20, 2025
@ScarletKuro ScarletKuro added the performance Time/memory/CPU/allocation performance characteristics label Mar 20, 2025
@codecov
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.05%. Comparing base (fa9ba33) to head (ca3b922).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #11067   +/-   ##
=======================================
  Coverage   91.05%   91.05%           
=======================================
  Files         429      429           
  Lines       13956    13964    +8     
  Branches     2698     2698           
=======================================
+ Hits        12707    12715    +8     
  Misses        646      646           
  Partials      603      603           

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ScarletKuro ScarletKuro merged commit 0943a12 into MudBlazor:dev Mar 20, 2025
5 checks passed
@sonarqubecloud
Copy link

@ScarletKuro ScarletKuro deleted the observermanager_optimize branch March 20, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended performance Time/memory/CPU/allocation performance characteristics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant