NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: Strip chart using up most of cpu

Hi Melba,

> One of the things we need from a charting package is to be able
> to display real-time data that is coming in at 10Hz.  One of the
> displays will be a strip chart, which is an x-y plot and all the
> points are plotted and it is moving as new data comes in.
>
> I tried to implement one using one of the tips I found in the
> mail archive about initially creating a large range-sample (10000) with
> NaNs, then as data comes in call setSample(index, data).
> setRange() is set to 500 points and as more data comes in
> setRange() is adjusted by 1.
>
>
> This certainly does what we want but as the data is accumulating
> (around 600 points) cpu usage jumps from 50% to ~99%.
>
> I'm sure if I saved off "old" data the display wouldn't use
> so much cpu to redraw, but our users will want to scroll back...
>
> Is this expected behavior since I'm keeping all the data?
> Do you have any recommendations?

You can cut way down on CPU usage by only updating the Data
values once every N-th point. If that was every 10-th point,
you'd cut CPU use by 90% but still give users an update every
second (at a 10 Hz data rate).

Please let us know if this does not solve your problem.

Good luck,
Bill


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: