Skip to content

Conversation

@Mark90
Copy link
Contributor

@Mark90 Mark90 commented Apr 18, 2025

The new SubscriptionModel querying from 3.2.0 turns out to have some adverse effects on the performance of the subscriptions GQL query, specifically when using the productBlockInstances field. This particularly affects the SubscriptionDropdownOptions query.

This PR mitigates this partially by:

  • Only loading the "extended" domain model if productBlockInstances { ... } contains field inUseByRelations
  • Adding a ModelCacheExtension to reuse loaded subscription models throughout each GQL query operation

Which, at least for the SubscriptionDropdownOptions query, reduces the execution time by 2/3rd.

Bumps version to 3.2.2


Related orchestrator-ui-library PR: workfloworchestrator/orchestrator-ui-library#1872

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 18, 2025

CodSpeed Performance Report

Merging #922 will not alter performance

Comparing gql-subscriptions-performance (0d5689f) with main (b584705)

Summary

✅ 13 untouched benchmarks

@codecov
Copy link

codecov bot commented Apr 18, 2025

Codecov Report

Attention: Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.

Project coverage is 83.49%. Comparing base (b584705) to head (0d5689f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
orchestrator/services/subscriptions.py 33.33% 2 Missing ⚠️
orchestrator/utils/get_subscription_dict.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #922      +/-   ##
==========================================
- Coverage   83.49%   83.49%   -0.01%     
==========================================
  Files         204      205       +1     
  Lines       10186    10206      +20     
  Branches     1020     1022       +2     
==========================================
+ Hits         8505     8521      +16     
- Misses       1411     1414       +3     
- Partials      270      271       +1     

☔ 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.

@Mark90 Mark90 changed the title Gql subscriptions performance Address performance regression in GQL subscriptions when using productBlockInstances Apr 18, 2025
@Mark90
Copy link
Contributor Author

Mark90 commented Apr 22, 2025

@Mark90 Mark90 marked this pull request as ready for review April 22, 2025 14:32
@Mark90 Mark90 merged commit 01237da into main Apr 24, 2025
16 checks passed
@Mark90 Mark90 deleted the gql-subscriptions-performance branch April 24, 2025 12:15
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.

4 participants