Performance of migrated VB6 applications to .NET

13. September 2007 10:34 by Fzoufaly in General  //  Tags:   //   Comments (0)

A common question when upgrading VB6 applications to .NET is regarding the performance of the application.

The short answer is that the migrated app typically performs as good as the original application. Let's dive into a couple of common issues that customers typically worry about:

1) the use of the VB6 compatibility classes in .NET: First of all, I believe this is a very bad namespace name! Everytime you hear compatibility library you think about performance. However, in this case, all the classes in the compatibility library are implemented in .NET. They are included just to simplify the maintainability of the code. The functionality that they provide is not directly provided by .NET, therefore, the correct way of implementing it is to just program it in .NET which is exactly what the compat classes do. NO performance penalty here! In addition, these classes are part of the .NET framework, thay are supported by Microsoft and they will continue to be supported for the forseable future! If there is a function in there that you want to use it, just do it!

2) COM Interop: The VB Upgrade Wizard generates primary assemblies for the COM component that are referenced from VB6. This is of course the fastest way to communicate with them from .NET. Now, typically, COM components are black boxes that presumably execute non trivial functionality. This means that typically the time spent by the execution of the COM component is orders of magnitude larger than the time spent in the calling of the component from .NET. Therefore the performance impact is negligible. This is not true of course if the COM interface is very chatty as you will have to go through the primary assembly overhead many times.

The reason to eliminate COM interop is normally not one of performance. You want to eliminate COM components for maintainability reasons, for deployment reasons or to take advantage of newer versions of the components. If you just want to maintain the same functionality COM interop does not present a performance situation.

In summary and reinforcing the introductory statement a converted application from Visual Basic 6 to .NET typically performs in the same way as the original one.

Have you had a different experience? Let me know!

Categories