Performance Tuning in vb.net application.

rajesh.forum

Well-known member
Joined
Sep 7, 2007
Messages
55
Programming Experience
Beginner
Hi all!!
Is there any Performance Tuning Concepts in Vb.Net Windows applications? Please let me know about the concepts..

with regards
rajesh g
 
Concepts... I am not sure that there exists concepts as is, but there are stuff that must be kept in mind in large apps with a database backend. Here's what comes to mind. I put them in order of importance, at least in my eye. Others may point out more stuff to look for.

Use the right events. This means that you should always double check that you are not doing a validation in the TextChanged method (which gets called at different times than Validating) and similar stuff. For this simple case, it's simple, but suppose you have 2 comboboxes, one for the country and one for the state, and you need the content of the state to change depending on the country selected. Then you also need to do some processing when country and state change. Which event throws when becomes more of a problem...

When accessing the database, you would use the strongly typed dataset to store your data. However, loading much information will hang your app and use enormous amounts of memory. Instead, use the virtual mode in datagridviews when needed and use custom FillBy methods to fill your datatables with only the necessary stuff instead of using client side filters.

Use multi-threading when necessary. When you are doing stuff in background, make sure you don't block the UI and have your action execute in a separate thread.

Use the designer for every single property you can. When the designer begins initializing stuff, it call SuspendLayout and when it finishes, ResumeLayout. This allows it to set many properties with a single component refresh (not on the screen, but internally). Any intialisation you can place between these two calls will benefit from this.

Otherwise, I would say that you are often better off using a method that is less efficient, but simpler to use as it will make your code easier to extend and possibly more efficient on the long term. I am currently rewriting a production application from scratch for my company because the previous implementation, which I had been adding stuff to for almost a year was beginning to crumble over the weight of its own complexity. The fact is, applications don't just sell as they are. They are customized, extended and spend so much time under the hammer that if you don't build a solid architecture and merely concentrate on efficiency, each further modification will weaken it until it breaks.
 
Back
Top