This project is read-only.

Performance Tips

May 20, 2009 at 4:53 AM

Hi Dynamic Data Display guys,

I love your product. It's excellent. I'm going to be using it to display streaming real time data. The more graphs with the more points I can display, the better the application will be. I wonder if you have any tips about how I can maximize the performance.

Is there a preferred data source to use for points?

I'm thinking of an array of doubles that is completely replaced every update, and raising the RaiseDataChanged event like in the animation sample, or

a RingArray<Point> like in the PerfCounter sample, or

an ObservableDataSource<Point> like in the SimulationSample.

Which is better, or is there no real difference?

Does using the readonly keyword make a difference?

Any other tips to maximize performance?

Thanks a lot and great work! I'm a big fan and you guys are making me look good.


May 21, 2009 at 12:18 PM



Thanks for your compliments)


I suppose that replacing array of doubles completely should work well in your case.

Observable collection, storing all data for a large period of time, while displaying only some latest data, will not be the best choice. Our RingArray<T> is simply a collection which deletes its first element when new element is added and its count is bigger than its capacity.

Readonly is simply a way to say to compiler that reference on some value should not be allowed to change. I don't think that this keyword can influence on performace.


If you get performance that is not satisfactory for you, please don't hesitate to contact me.

Best regards,


May 23, 2009 at 4:32 AM

Thanks for your reply.

I might not have really described the problem well enough for you to give a good answer. We're getting data at an update rate of 1 hz, and we're getting a lot of different fields, say hundreds of different fields at this 1 hz rate. Each field is a double, and we'd like to display up to the last hour of as many fields as possible - 3600 points. It will be impossible to display them all, of course, but it would be great to display a lot.

In this case, is completely replacing the array of doubles every second, even though we only have one new data point, and then raising the raisedatachanged event the fastest?

Do you have any advice regarding threads? I see the SimulationSample retrieves the point to add to the ObservableDataSource in a seperate thread, and then asks the dispatcher to add the point and raise the RaiseDataChanged event. That seems like a good way to do it to me - you have any thoughts about thread optimization?


Thanks again. You're awesome. :)

May 25, 2009 at 10:36 AM



Well, I thought that each second you are getting completely new data. In youк case, of cource, it is better to use ObservableDataSource and to add new point to it as it is received. RingArray is designed to be used when you have points repeatedly being added to it, but you are displaing only some fixed amount of latest points - in this case all previous points will be lost and final amount of points that will be passed to points filter will be not large.

I don't think that it is necessary to create an independent thread - total number of data items and frequency of their addition is not very large.


Best regards,


Jun 29, 2009 at 7:02 AM

My program gets points from the device with the rate up to 10kHz - that's a real challenge for D3 :-)

I filter received points in another thread and only after that push them to D3.  Everyting works fine till user changes scale. The source of the points is not locked thus I get the exception: "Collection was changed". Sure I can move filtering to UI Thread but UI responsiveness considerably slows. I think the best solution is to make plot "static" i.e. nonresponsive to user input while data flow is not stopped.

Any other advices?

Jul 6, 2009 at 2:16 PM


Maybe you should create a new collection (array, maybe) and copy filtered items in worker thread, and then pass this collection to D3?

Or maybe you can have collection of items being displayed in D3, and add filtered items from worker thread to this collection using Dispatcher in UI thread?


Best regards,