Page 1 of 1

speeding up colorGridSeries

Posted: Sat Aug 09, 2008 1:24 am
by 10047094
Hello,

We were adding 1024 x 1024 pixel images to to a TColorGridSeries. The images were computed and then added to the TColorGridSeries by doing AddXYZ. It was soo slow, even with optimizations suggested by Narcis.

Profiling indicated that adding the colors to the FColors array was taking a huge amount of time. However, FColors is declared as private in TChartSeries.

We modified the source to expose the FColors and then populated the XValues.Values, YValues.Values and then allocated all the memory for the FColors at one time and filled it up. This cut about 40% of the time.

Everything seems to work fine. Are there any problems with this approach we should be aware of? If not, can I make a suggestion that

1) you make FColors a typesafe List of TColor
2) you expose it for optimal speed in adding colors to a TColorGrid

Posted: Mon Aug 11, 2008 12:03 pm
by Pep
Hi dave,

thank you for your feedback. I don't think this could be problematic. We'll check the part of sources related on this and will try to include these features for the next major releases.