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

[Conditionals] Increase performance, switch to TelemetryCollections #7841

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

jvigliotta
Copy link
Contributor

@jvigliotta jvigliotta commented Sep 12, 2024

Closes #7840

Believe this may be the issue reported in: VIPERGC-550

Describe your changes:

Add some performance enhancements to conditional styling:

  • handle visibility separately
  • create style string set it once
  • apply styles in requestAnimationFrame

Switched to TelemetryCollections from older and separate subscribe and historical request. This prevents situations where different telemetry was being evaluated in a condition vs the telemetry itself in the item being styled with the condition. This also just brings conditions in line with the rest of our code that uses TelemetryCollections.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

Copy link

codecov bot commented Sep 12, 2024

Codecov Report

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

Project coverage is 58.78%. Comparing base (de122b9) to head (73489cd).

Files with missing lines Patch % Lines
...gins/plot/stackedPlot/mixins/objectStyles-mixin.js 70.00% 3 Missing ⚠️
src/plugins/condition/ConditionManager.js 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7841      +/-   ##
==========================================
- Coverage   58.88%   58.78%   -0.11%     
==========================================
  Files         675      675              
  Lines       27284    27277       -7     
  Branches     2671     2671              
==========================================
- Hits        16066    16034      -32     
- Misses      11171    11195      +24     
- Partials       47       48       +1     
Flag Coverage Δ
e2e-ci 61.76% <86.20%> (-0.02%) ⬇️
e2e-full 23.52% <0.00%> (+0.01%) ⬆️
unit 51.21% <62.06%> (-0.13%) ⬇️
Files with missing lines Coverage Δ
src/plugins/condition/ConditionManager.js 87.75% <94.73%> (-3.25%) ⬇️
...gins/plot/stackedPlot/mixins/objectStyles-mixin.js 85.41% <70.00%> (+1.10%) ⬆️

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de122b9...73489cd. Read the comment docs.

@ozyx ozyx self-requested a review September 12, 2024 19:57
@ozyx ozyx added this to the Target:4.0.1 milestone Sep 12, 2024
Copy link
Member

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Nice work! and nice job cleaning up that wild style code. I have a couple of suggestions where we can further improve performance, and I have some other suggestions for readability improvements.

Also this needs test(s) 😛

btw this test is failing in ci: [chrome] › functional/plugins/styling/stackedPlotStyling.e2e.spec.js:159:3 › Stacked Plot styling › styling a child object of the flexible layout properly applies that style to only that child

src/plugins/condition/ConditionManager.js Outdated Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Outdated Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Outdated Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Show resolved Hide resolved
src/plugins/condition/ConditionManager.js Show resolved Hide resolved
src/plugins/plot/stackedPlot/mixins/objectStyles-mixin.js Outdated Show resolved Hide resolved
@jvigliotta jvigliotta added the pr:e2e:couchdb npm run test:e2e:couchdb label Sep 17, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Sep 17, 2024
@khalidadil
Copy link
Contributor

@ozyx was this change still under review? It touches some code in a file that I'm also working on (ConditionManager.js), so I want to get it merged into my branch when it's ready

@ozyx
Copy link
Member

ozyx commented Sep 19, 2024

@ozyx was this change still under review? It touches some code in a file that I'm also working on (ConditionManager.js), so I want to get it merged into my branch when it's ready

It just needs a test. So you can probably safely rebase onto this branch and then rebase onto master once you're ready to open a PR

@khalidadil
Copy link
Contributor

@ozyx was this change still under review? It touches some code in a file that I'm also working on (ConditionManager.js), so I want to get it merged into my branch when it's ready

It just needs a test. So you can probably safely rebase onto this branch and then rebase onto master once you're ready to open a PR

awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Condition Manager is using older telemetry API and conditional styling can use a performance upgrade
4 participants