Menu

#27 Performance for traces with large amount of data.

open-accepted
None
5
2012-01-02
2008-05-29
No

Traces with huge amount of date are senseless when no zooming (ZoomableChart) is used: 10.000 points on a screen with 1920 pixel width does not change the visible result compared to 2000 points but costs performance.

It would be possible to only render every nth point (or the arithmetic mean of the most recent n points) when

ITrace2D.iterator()

is changed to:

Itrace2D.iterator(Range visibleRange, int amountOfVisiblePoints)

visibleRange would be used for the iterator to not return the invisible points. amountOfVisiblePoints would be used by the iterator to fold several points into one if a multiple of the requested points are contained in the visible range.

Caution: Because a 2nd ionternal iteration for filtering out the invisible points in initialization of the iterator would be required this signature should only be used in case the chart detects that a range policy of an axis does limit it's min and max bounds. If not another signature:

Itrace2D.iterator(int amountOfVisiblePoints) should be used which just avoids to try to iterate and paint "10.0000" points.

Discussion

  • Kali

    Kali - 2008-12-08

    Hi Achim,

    why iterate over the trace, instead of iterating over the pixels and request/calculate the corresponding data. So you have only 1920 pixels to draw, even if the data consists of 10000000 points.

    Regards,

    Michael

     
  • Achim Westermann

    HI Michael,

    good idea. However: the calculations to find out which values will correspond to a pixel would be expensive. But the plan may work similar: Pass in the amount of pixels the chart has to the iterator as the value of amount of points that should be retrieved.

    Late response just read this now.

    cheers, Achim

     
  • Achim Westermann

    Another idea: Also extend the ITrace2D by a configurable AccumulationFunction instance which will by default accumulate nothing. For high performance realtime perhaps this should be done in a sub interface to still allow totally not using the accumulation bypass dummy....

     
  • Achim Westermann

    A first version is now in GIT master.
    ! Introduced data accumulation API. This allows you to have traces with 10^6 points painted with increased speed while zooming in
    will show details with higher point resolution. By default this is bypassed. Turn it on with:
    ITrace2D.setAccumulationStrategy(new AccumulationStrategyAmountOfPointsAscendingXValues(new AccumulationFunctionArithmeticMeanXY()));

     
  • Achim Westermann

    • status: open --> open-accepted
     
  • Achim Westermann

    • assigned_to: nobody --> achimwestermann
     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.