tags:

views:

56

answers:

1

I am new to wpf and from what i've seen it uses reflection a lot. My question may seem silly..Are win forms drawn faster than how wpf windows are rendered(especially when working with lots of data)?

+1  A: 

No, quite the opposite. WPF generally performs much better than WinForms.

Jim Lamb
That's interesting... I would have imagined the opposite for various reasons, one being that it has to parse the XAML. Does it maybe have a bit of initial overhead compared to WinForms, but in the long run ("working with lots of data") more performant?
Nelson
@Nelson: In general, XAML can be regarded as metadata; the parsing is done up front and objects are instantiated, properties are set, and events are attached (it's obviously more complex than that, but you get the gist).
Adam Robinson
@Adam: That's basically what I meant with "initial overhead". It's only parsed once, O(1), whatever. Probably negligible. When interacting with it, processing lots of data, resizing the window, it's always (or usually) more performant? Isn't a WPF form handled more as a "canvas" instead of Win32 handles? I have no idea here, just asking. :)
Nelson
@Nelson: Right, I just wanted to clarify that rendering and interaction in WPF has nothing to do with XAML (other than the fact that the XAML can define how these things behave), since the XAML is processed up front. As for WPF being a "canvas", that's correct but misleading; the speed of WPF comes (largely) from the use of DirectX to perform *all* graphics operations, rather than GDI (which is what a "canvas" might imply).
Adam Robinson