1

Is it possible?

We've been having some performance issues with our datagrid, and have tried many of the tips and tricks to improve it (e.g. here and here). None of these made much of a difference.

I reduced the problem to a screen's worth of TextBlocks on a canvas. Even this will cause the framerate drop to less that 1/sec and eats the entire cpu. At this point the wpf performance monitor ceases to function, but with a smaller window size, layout and rendering are split about 50/50.

Is any way to get wpf to display this sort of data, or will we need to switch to something lower level? This WPFTextBenchmark seems to suggest that the default wpf text display is just a lot slower that other methods.

Edit, additional information:

The idea behind the canvas with textboxs is to reduce the layout calculations, as one textblock's position will be unaffected by the others.

Edit in response to comments:

1) We're looking at many hundreds of cells (about a screens worth), many update multiple times a second, some may be unchanged for minutes. We don't care about updates that are more rapid that would be noticable (say 5/sec) however.

2) We're using INotifyPropertyChanged and DataBindings to update the UI.

Community
  • 1
  • 1
Matthew Finlay
  • 3,354
  • 2
  • 27
  • 32

1 Answers1

1

You might want to look at other ways of updating the values besides binding. Bindings are traditionally slow and it might be better to bind your control to all the data, and let the control figure out how to get the actual value it needs.

Another idea is instead of having the whole thing data driven (data change -> UI updates) make it UI driven instead (UI refreshes every 5th sec -> pulls the latest values from the data). This isn't the usual way of doing things in WPF but it works.

Cameron MacFarland
  • 70,676
  • 20
  • 104
  • 133