Click here to Skip to main content
15,885,638 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I wanna know whether DataBinding and CommandBinding would cost more GPU resource than traditional way(such as assigment and event,etc) or not, and the reason.

Thanks for any ideas.

When I 'wanna' know such a thing, I usually set up a small test with both alternatives in question and simply get my answers by measuring the performance. But, generally, you may safely assume that data binding does not happen by magic and is more CPU intensive than simply setting values and properties directly. The reason for this is, that generic data binding must obtain needed information via reflection, which is a bit slow.
Share this answer
Sparkling_ouc 29-Apr-11 5:24am    
Thanks for your suggestion. I did set up a small test project ,but i don't know how to measure the cost, any ideas?
Hemant__Sharma 29-Apr-11 5:38am    
You can pass huge data for binding and see the usage of GPU with a proper tool. try searching some free tool to check GPU usage. i've not tried but found a link
Sparkling_ouc 29-Apr-11 5:58am    
ok, I will test it .

Thank you very much. Good Day!
[no name] 29-Apr-11 6:02am    
Now, that's interesting for me as well. I'm working on a GUI for XNA and up to now only have profiled and optimized the code on the CPU side. Additional information about the GPU will be valuable.
In addition to what CDP1802 said all UI controls in WPF is a new composition model. Every control is composed of one or more ‘visuals’. These visual sub-elements are turned into a hierarchical Visual Tree by WPF and eventually rendered by the GPU.

So its the rendering process which is done by a GPU. Generally GPU's are not x86 and x64 based and the data binding code is the IL code which needs to be processed by CLR and because its not related to UI its processed by CPU.

You can see the documentation to check Graphics Rendering Tiers in WPF

Share this answer
[no name] 29-Apr-11 5:44am    
Thanks, good addition. GPUs are great when you have batches of parameters for calculations. Data binding does not need much in that direction. It relies more on reflection and that is work for the CLR and CPU.
Hemant__Sharma 2-May-11 0:20am    
I agree.
Sparkling_ouc 29-Apr-11 5:58am    
Thanks a lot , what you said made me clearer about it.
Hemant__Sharma 2-May-11 0:20am    
Happy to help :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900