You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
determineDataLimits is an expensive calculation, and should only be called when needed. If a graph has two axes, determineDataLimits should only be called twice per update.
Current Behavior
determineDataLimits is called five times per update:
twice during getMinimumBoxSize
twice during fitBox
once during finalFitVerticalBox
Possible Solution
Perhaps we could cache the result of determineDataLimits, or ideally refine the chart update lifecycle to not require a scale to be updated at each of the stages mentioned above.
Steps to Reproduce (for bugs)
Create a chart with two axes
Add a dataset to the chart
Update the dataset
Context
determineDataLimits is quite an expensive function. It could also be optimised, but the first step would be to remove duplicate calculations. In my performance tests, each subsequent identical call to determineDataLimits is faster due to JIT optimisations, but this is reliant on the underlying engine to optimise things.
Environment
Chart.js version: 2.7.2
Browser name and version: Chrome
The text was updated successfully, but these errors were encountered:
@veggiesaurus the caching is an interesting idea. @simonbrunel what are your thoughts? I don't think the output of determineDataLimits should change during a single update so caching at some level seems to make sense.
Expected Behavior
determineDataLimits
is an expensive calculation, and should only be called when needed. If a graph has two axes,determineDataLimits
should only be called twice per update.Current Behavior
determineDataLimits
is called five times per update:getMinimumBoxSize
fitBox
finalFitVerticalBox
Possible Solution
Perhaps we could cache the result of
determineDataLimits
, or ideally refine the chart update lifecycle to not require a scale to be updated at each of the stages mentioned above.Steps to Reproduce (for bugs)
Context
determineDataLimits
is quite an expensive function. It could also be optimised, but the first step would be to remove duplicate calculations. In my performance tests, each subsequent identical call todetermineDataLimits
is faster due to JIT optimisations, but this is reliant on the underlying engine to optimise things.Environment
The text was updated successfully, but these errors were encountered: