Closed 7ymekk closed 2 years ago
performance gain is really great:
16 charts: 5 - 13 series with 1830 rows
PC with AMD Ryzen 7 4800H: 8s -> 2.4s ARMv7 Processor rev 10 (single 1GHz core) : 160s -> 38s
Another way around for it would be storing minValue & maxValue inside ChartItem class and changing it whenever m_series is being changed.
I think we can make catchable results for maxValue() and minValue() and drop them on series changes.
Changes were merged. Issue can be closed.
Hi @fralx,
I have found out that LinesChart::paintSerialLines could use some optimizations that IMO would speed up rendering quite significantly.
I'm pasting below the current maxValue & minValue code + LinesChart::paintSerialLines.
Please notice how LinesChart::paintSerialLines uses maxValue & minValue few times,
Now, I could fix all of the charts with temp variable
auto maxValue = this->maxValue()
but if maxValue is used in some other method, then this optimization would have to go in every place it's used. Another way around for it would be storing minValue & maxValue inside ChartItem class and changing it whenever m_series is being changed. You know the best place for it so I guess you could give me a hint for this. I plan to push this as pull request in here if you agree it's useful for you.PS. I noticed that Bar & Pie chart are also using maxValue & minValue few times, so this fix would improve all plots rendering.
Thanks Jakub