ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Is it possible to reuse the buffer generated by BaseChart.makeChart?
Posted by Naveen Michaud-Agrawal on Feb-28-2014 22:25
Hi Peter,

I'm using the C++ ChartDirector api with the Qt widget, and I was wondering if it was
possible to pass in a buffer to makeChart. I'm generating a lot of updates when the user
interacts with the widget, and I would like to avoid the memory churn of having
chartdirector allocate a buffer which is then copied into a Qt bitmap on every update. Since
resize events are less frequent, it should be possible to reuse the allocated buffer for
redraws. If this is not currently possible, please consider this as a feature request.

Regards,
Naveen

  Re: Is it possible to reuse the buffer generated by BaseChart.makeChart?
Posted by Peter Kwan on Feb-28-2014 23:52
Hi Naveen,

We had actually done benchmark testing in reusing the frame buffer has no benefit. We
found that except in some very old version of Java (of which the garbage collector is not
efficient), there is minimal benefit in reusing the buffer. For this reason, only the Java
edition of ChartDirector has an API to reuse the buffer.

In C++, allocating and freeing a buffer takes negligible CPU time comparing to the CPU time
needed to render a chart. Also, allocating a buffer does not take additional memory, as the
old buffer is freed. So there is minimal benefit in reusing the buffer.

Regards
Peter Kwan