within my scientific software for optical spectra, I use TFastLineSeries to display the spectrum traces in a Teechart. One option is to create "peak labels", which are realised as TSeriesMarks with Callouts (see attached "peaklabel_sample.png"). Sometimes, spectra are huge with 50,000 or even 100,000 datapoints each. They still can be quickly displayed, and even dozens of them. So far no problem. When adding the "peak labels" at a few positions (the local maxima of the series), I set
Series.Marks.Visible:=true
and to hide all marks except those used as "peak labels", I set Series.Marks.Item[i].Text.Text:=''
for all other data points. On doing this step for a spectrum with 65000 data pints, the memory increases by about 50-60MB, which is way too much in my opinion. This easily leads then to a OutOfMemory error for the application, if done for a set of 30 spectra or so.On doing the same with leaving out the
Series.Marks.Item[i].Text.Text:=''
step, the spectra display is totally cluttered with all the marks of course, but memory increase is only a tiny fraction of it (less than 1MB for each spectrum). Could you help me to improve this performance? I've attached a small demo project showing the behaviour. You will see the difference on commenting out line 112. I also tried using setting Marks.Items[i].Visible
for each datapoint instead, but this gives the same waste of memory.Thanks a lot in advance!
Friedrich
P.S.: my system: Win7 Pro SP1, Delphi XE5, Teechart Pro VCL 2019.28