Improve normalized stack bar performance
I had a huge performance regression for normalized stack bar when I have a thousand bar and ~10 series.
It makes the browser hang for a while, stuck in 'filterTargetsToShow' mainly.
When I investigated I found that:
- the calls to 'api.data.shown' seems unnecessary.
- we normalized values for a lot of unnecessary targets. Like a LOT, coupled with the fact that 'filterTargetsToShow' were copying the targets it had a huge hit
Codecov Report
Merging #2699 into master will decrease coverage by
0.04%. The diff coverage is90.32%.
@@ Coverage Diff @@
## master #2699 +/- ##
==========================================
- Coverage 82.68% 82.64% -0.05%
==========================================
Files 59 59
Lines 4718 4724 +6
==========================================
+ Hits 3901 3904 +3
- Misses 817 820 +3
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/shape.js | 95.52% <100%> (+0.13%) |
:arrow_up: |
| src/data.js | 88.34% <83.33%> (-0.79%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 93dcd65...115cb29. Read the comment docs.
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
:x: Patch coverage is 90.32258% with 3 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 82.64%. Comparing base (93dcd65) to head (115cb29).
:warning: Report is 93 commits behind head on master.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/data.js | 83.33% | 3 Missing :warning: |
| :exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality. |
Additional details and impacted files
@@ Coverage Diff @@
## master #2699 +/- ##
==========================================
- Coverage 82.68% 82.64% -0.05%
==========================================
Files 59 59
Lines 4718 4724 +6
==========================================
+ Hits 3901 3904 +3
- Misses 817 820 +3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.