WPF Performance
-
performant is a real word and it is derived from the french language I believe.
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
If it is a real word it doesn't mean what JSOP thinks it means.
-
If it is a real word it doesn't mean what JSOP thinks it means.
viaducting wrote:
If it is a real word
Proof: it's a french based word[^]
viaducting wrote:
it doesn't mean what JSOP thinks it means.
Now that's between you and him. :)
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
-
If it is a real word it doesn't mean what JSOP thinks it means.
viaducting wrote:
If it is a real word it doesn't mean what JSOP thinks it means.
If this is a real world, it doesn't mean we are what we think we are. best, Bill
"In the River of Delights, Panic has not failed me." Jorge Luis Borges
-
viaducting wrote:
If it is a real word
Proof: it's a french based word[^]
viaducting wrote:
it doesn't mean what JSOP thinks it means.
Now that's between you and him. :)
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
Slacker007 wrote:
Proof: it's a french based word[^]
Oh, there's a ringing endorsement :rolleyes:.
Software Zen:
delete this;
-
Reputationator isn't NEARLY that complicated. The two comboboxes on the form are populated only once, the two ListViews are ppopulated only once. Only one control (the CheckListBox) is a two-way control (and it's also only populated once). The delay happens whenever I change any criteria for the chart. When the chart criteria change, the existing series are removed, and a new set are added, and the only chart stuff that lives in the XAML are the various data point control templates, so that means that 99% of the chart building happens in the code as opposed to the XAML. The Winforms version essentially does it the same way. I hope to be posting an update to Part 4 of the series with the finished code sometime this weekend. You can look at it then if you want to. It's certainly not a show stopper, but the difference in respovieness is noticable (and I'm running a quad-core 16-gb machine at home).
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997Assuming that the chart is a drawing task, I also think this is weird, altough I can speculate: Winforms uses GDI+ for drawing and WPF uses DirectX for drawing. DirectX drawing is supposed to be faster, since it uses the video card to perform the rendering. GDI+ uses the processor (software) to perform rendering, so if you got a good processor and a crappy integrated GPU, the rendering might actually be worse with DirectX.
"To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson
-
performant is a real word and it is derived from the french language I believe.
Just along for the ride. "the meat from that butcher is just the dogs danglies, absolutely amazing cuts of beef." - DaveAuld (2011)
http://dictionary.reference.com/browse/performant[^] It is a word, and has nothing to do with the context in which it was given. Perhaps he meant to use "performance".
-
I'm finishing up on a WPF version of Reputationator, and have observed that the WPF app UI is markedly less performant than the WinForms version. Has anyone else done something similar (create a winforms and wpf version of the same app), and then observed similar results? I have to admit that I was somewhat shocked.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997This is an illusion when some people don’t know they need to plug VirtualizingStackPanel in to the DataGrid for displaying large-scaled data.
-
Do you believe all the blog posts you read? If so, I've seen a few from people that talk about the reptillian aliens that are controlling our planet from secret underground lairs. :)
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997Do not speak of our benevolent alien overlords! Repent! Repent! (From the Reptilian root "-repost", to eschew responsibility for obfuscatatory text being presented as authoritative data). Oh wait, it's not Labor Day, yet. You're fine. Please continue. :omg:
-Bob
-
Rama Krishna Vavilala wrote:
That is what I am surprised at. How can reflection and binding can actually lead to better performance then directly adding items? Something is not adding up here. WPF performance issues are mostly due to rendering, so I am more surprised that data-binding or not will improve the performance. Win32 (hence Winforms) rendering is actually faster. Do you know what WPF is doing to optimize the data binding which causes improvement in performance? I doubt they can bypass reflection.
Ok I am not explaining myself well I think. Imagine this scenario, you have a combobox where you want to show country names and another combobox where you want to show state names corresponding to the selected country. (1) Data-binding scenario: Initially, this is slow. Reflection is involved when the data is bound. This is a one-time cost. Now as you change the selection in the country combobox, the states combobox is bound to the selected-item's states property (assume each country object has a states collection). This update automatically happens through property change notifications (assuming you've correctly bound to the selecteditem). (2) Direct manipulation scenario: Initially, this is faster since there's no reflection involved. But consider selection changes. The country combo's selection changed event is handled. Now the user code has to get the new selected item, get the states collection and then manually clear/re-populate the states combobox. In my view (2) is slower in the long run. This gets worse if you have a 3rd bound control, say an image which has to show the country's flag. Now with data-binding this is merely a matter of property change event handling and binding to selected item. With direct manipulation there's more work involved. Not to mention that user written code may have further inefficiencies that may not be obvious. Again I suspect my explanations are probably not very clear so maybe I am not making my point here.
Regards, Nish
My technology blog: voidnish.wordpress.com
I wish people didn't use list boxes for states. That is the worst way to select 50+ states with a mobile device using the iPhone spinner control or mouse. It is even worse when they lump our friends up north with New Brunswick in the states list! I punish you to live in NY and select NY from this abomination 1000 times. Lists boxes should not have more than 10 items. This should be taught in UI design 101. Thanks
Dave
-
I'm finishing up on a WPF version of Reputationator, and have observed that the WPF app UI is markedly less performant than the WinForms version. Has anyone else done something similar (create a winforms and wpf version of the same app), and then observed similar results? I have to admit that I was somewhat shocked.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997 -
I wish people didn't use list boxes for states. That is the worst way to select 50+ states with a mobile device using the iPhone spinner control or mouse. It is even worse when they lump our friends up north with New Brunswick in the states list! I punish you to live in NY and select NY from this abomination 1000 times. Lists boxes should not have more than 10 items. This should be taught in UI design 101. Thanks
Dave
Egads, I know what you mean. It's somewhere in the lower-middle of all lists. Sometimes you have to press N six times, other times 7. I'd rather have auto-complete and just type the abbreviation. Do you have a better design in mind, though? I don't... Maps are too difficult to design well, usually.
-
I'm finishing up on a WPF version of Reputationator, and have observed that the WPF app UI is markedly less performant than the WinForms version. Has anyone else done something similar (create a winforms and wpf version of the same app), and then observed similar results? I have to admit that I was somewhat shocked.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997In several years now of building WPF applications, I have rarely seen a visible performance degradation due to WPF as opposed to Winforms or even C++. Yes, I generally leave my compute-intensive video analysis or neural-net computations in C++ and call those routines from the WPF app, but other than that WPF has been extraordinarily productive for me. The main exception was just before 3.5 sp1 came out, and I was doing very-detailed waveforms, that were animated in realtime and feed by 256 sensors. That was pushing the edge. I would love to see exactly where you're perceiving a performance hit, and profile it. I've used Red-Gates ANTS Profiler with good results -- it's a splendid tool (not free, but a heck of a bargain for my needs) and highly recommend it. Other than the animated-waveform project (which I wound up solving in WPF after all) I have never, ever seen a real performance hit in the GUI, relative to Winforms or even C++/MFC/wxWidgets, other than when I had made some coding mistake. I'm talking about the GUI action itself. I noticed amongst the other threads that you're loading something like 500+ objects into a ComboBox? That's not a level that ought to significantly impact your performance, visually - depending upon how fast that source is. But it does merit a think-through on the data-binding strategy. What I often do is handle the data-loading on the content-rendered event, after the view is already visible to the user and before he has time to slide his mouse over to your controls. You have hundreds of milliseconds during that time to play with, without the user perceiving it at all. On the other hand, if you're pulling data through a slow webservice or some such, it might make sense to kick off a work thread immediately, as early as possible, to get those results ready for the GUI. And of course for very large lists - virtual loading is a possibility to consider. There are, too, times when I don't use data-binding at all. It's a useful tool, but I think it's wise to keep an open mind rather than to adhere to the MVVM paradigm religiously. Best of wishes, James W. Hurst
James Hurst "The greatness of a nation and its moral progress can be judged by the way its animals are treated."
Mahatma Gandhi -
In several years now of building WPF applications, I have rarely seen a visible performance degradation due to WPF as opposed to Winforms or even C++. Yes, I generally leave my compute-intensive video analysis or neural-net computations in C++ and call those routines from the WPF app, but other than that WPF has been extraordinarily productive for me. The main exception was just before 3.5 sp1 came out, and I was doing very-detailed waveforms, that were animated in realtime and feed by 256 sensors. That was pushing the edge. I would love to see exactly where you're perceiving a performance hit, and profile it. I've used Red-Gates ANTS Profiler with good results -- it's a splendid tool (not free, but a heck of a bargain for my needs) and highly recommend it. Other than the animated-waveform project (which I wound up solving in WPF after all) I have never, ever seen a real performance hit in the GUI, relative to Winforms or even C++/MFC/wxWidgets, other than when I had made some coding mistake. I'm talking about the GUI action itself. I noticed amongst the other threads that you're loading something like 500+ objects into a ComboBox? That's not a level that ought to significantly impact your performance, visually - depending upon how fast that source is. But it does merit a think-through on the data-binding strategy. What I often do is handle the data-loading on the content-rendered event, after the view is already visible to the user and before he has time to slide his mouse over to your controls. You have hundreds of milliseconds during that time to play with, without the user perceiving it at all. On the other hand, if you're pulling data through a slow webservice or some such, it might make sense to kick off a work thread immediately, as early as possible, to get those results ready for the GUI. And of course for very large lists - virtual loading is a possibility to consider. There are, too, times when I don't use data-binding at all. It's a useful tool, but I think it's wise to keep an open mind rather than to adhere to the MVVM paradigm religiously. Best of wishes, James W. Hurst
James Hurst "The greatness of a nation and its moral progress can be judged by the way its animals are treated."
Mahatma GandhiTurning off the animations seems to have helped a little.
JamesWittHurst wrote:
I noticed amongst the other threads that you're loading something like 500+ objects into a ComboBox?
I thin you misread something. The combo boxes are loaded statically (in the XAML) at program startup, and together, there are about a dozen items between the two controls. The "500" number is the current approximate number of items in the dataset used by the charts, with a max possible count of 2920) at any given time.
JamesWittHurst wrote:
I think it's wise to keep an open mind rather than to adhere to the MVVM paradigm religiously.
I don't intentionally use any of the named patterns, religiously or otherwise. :) Do you, by any chance, ever answer questions in the Silverlight/WPF forum?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997 -
Reputationator isn't NEARLY that complicated. The two comboboxes on the form are populated only once, the two ListViews are ppopulated only once. Only one control (the CheckListBox) is a two-way control (and it's also only populated once). The delay happens whenever I change any criteria for the chart. When the chart criteria change, the existing series are removed, and a new set are added, and the only chart stuff that lives in the XAML are the various data point control templates, so that means that 99% of the chart building happens in the code as opposed to the XAML. The Winforms version essentially does it the same way. I hope to be posting an update to Part 4 of the series with the finished code sometime this weekend. You can look at it then if you want to. It's certainly not a show stopper, but the difference in respovieness is noticable (and I'm running a quad-core 16-gb machine at home).
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997John Simmons / outlaw programmer wrote:
the existing series are removed
Presumably the series is a collection, have you tried using .Clear() instead of removing/adding.
Never underestimate the power of human stupidity RAH
-
Yikes! I hope not, we declared the end of Winforms operations for all future dev going forward and I need to port a *huge* app to everything that is not winforms shortly.
There is no failure only feedback
Welcome to my world except we are going to Silverlight. At least users are used to crappy response times when using a browser app. The old busyindicator gets a serious work out.
Never underestimate the power of human stupidity RAH
-
Welcome to my world except we are going to Silverlight. At least users are used to crappy response times when using a browser app. The old busyindicator gets a serious work out.
Never underestimate the power of human stupidity RAH
My world actually *is* your world because we're going to silverlight / wpf and html5 jQuery with specific front ends for full browsers and specific phone and tablet browsers. Before March 2012. Almost entirely by myself. Just working on the backend right now.
There is no failure only feedback
-
My world actually *is* your world because we're going to silverlight / wpf and html5 jQuery with specific front ends for full browsers and specific phone and tablet browsers. Before March 2012. Almost entirely by myself. Just working on the backend right now.
There is no failure only feedback
John C wrote:
Just working on the backend right now.
Pfft back end is easy stuff, build the database (presumably already there) and use your code generator to produce the WCF. Wiring up the different UIs on the other hand should be a challenge. No more 3d rendering for you in the near future!
Never underestimate the power of human stupidity RAH
-
John C wrote:
Just working on the backend right now.
Pfft back end is easy stuff, build the database (presumably already there) and use your code generator to produce the WCF. Wiring up the different UIs on the other hand should be a challenge. No more 3d rendering for you in the near future!
Never underestimate the power of human stupidity RAH
I know the front end is more time consuming but generating code off a database? This is no throw away project, this is a complete re-write of an existing commercial off the shelf software used world wide. The back end is very complex and coded entirely by hand with very sophisticated business rules and ... well I could go on and on. Suffice to say I'm not generating any code at all. I would almost say I never will generate code but maybe some day they will invent code generation that is actually useful for something.
There is no failure only feedback
-
I know the front end is more time consuming but generating code off a database? This is no throw away project, this is a complete re-write of an existing commercial off the shelf software used world wide. The back end is very complex and coded entirely by hand with very sophisticated business rules and ... well I could go on and on. Suffice to say I'm not generating any code at all. I would almost say I never will generate code but maybe some day they will invent code generation that is actually useful for something.
There is no failure only feedback
John C wrote:
commercial off the shelf software
Ah we live in different worlds after all, I write inhouse corporate software these days, a whole lot easier than writing commercial grade stuff. All the CRUD work in the WCF is built by a code generator (mine), the models are nearly all based on the underlying tables/views so the WCF only needs hand coding for the stored procs. There is almost no business logic in the WCF, it resides in the VM or the stored procs. I haven't worked on a single app/suite for years at a time since the 90s, we churn out small solutions every 2-3 months meeting specific requirements (limited).
Never underestimate the power of human stupidity RAH
-
Egads, I know what you mean. It's somewhere in the lower-middle of all lists. Sometimes you have to press N six times, other times 7. I'd rather have auto-complete and just type the abbreviation. Do you have a better design in mind, though? I don't... Maps are too difficult to design well, usually.
The two letters typed in. The keyboard on desktop no problem, and not bad on most mobile devices. Most people know their country code and state abbreviation. Could validate against known state codes and/or expand in adjacent field.