Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.14.2
-
None
Description
I have 155 objects each containing 11 QtCharts::QLineSeries. So this makes a total of 1705 QLineSeries objects. The current design accumulates points every second up to 86400 points to contain a range of 24h.
At each second, I'm adding a point to all 1705 series object.
When I launch my program and start collecting data, CPU usage is at around 20%. After about an hour, processor usage saturates at 100%.
I think that I suffer from a realloc bomb. When my Series point capacity is reached, all 1705 series will reallocate at the same time.
I have 2 suggestions for this class:
- You should allow a QXYSeries user to call reserve() on the underneath QVector. (perhaps by adding QXYSeries::reserve() method
- You should make it hard to misuse your class by deprecating points() method. I was exhaustively using it without being aware of the performance cost that I was paying using it...