Consultor Eletrônico



Kbase P162282: Why is my .NET form loading slowly?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/9/2011
Status: Verified

GOAL:

Why is my .NET form loading slowly?

GOAL:

Why is Visual Studio faster than ABL at loading the same form?

FACT(s) (Environment):

OpenEdge 10.2B
Windows

FIX:

The performance of an OpenEdge GUI for .NET application depends on several characteristics of the OpenEdge architecture:

(1) GUI for .NET is not ABL.NET. In other words, ABL is not a .NET language. Instead, there is a "bridge" that allows the ABL virtual machine to communicate with the .NET CLR (another virtual machine) running in the same process.

(2) The data types of the two virtual machines are not the same. Communication requires that data be marshaled between the two very different memory management spaces.

(3) The ABL is essentially a run-time interpreted dynamic language. Compilation to r-code optimizes many things, but the execution of the language is essentially dynamic and is not at any point compiled to native machine instructions, as are .NET programs.

Because ABL is not a .NET language, it can never achieve the performance of a .NET application. A pure .NET application written only in .NET languages will benefit from compile-time and run-time (JIT) optimizations. In addition, there will be no marshalling since the data types are native and are in the same memory space.

The OpenEdge GUI for .NET is designed for the ABL developer that wants to work with .NET classes and remain completely in OpenEdge. .NET objects are used exactly as ABL objects by the developer. The OpenEdge GUI for .NET creates .NET objects and interacts with them using dynamic invocations. Dynamic invocations do not perform as well as optimized compiled code. We could have generated compiled .NET proxies but the customer feedback preferred simplicity over static proxies. The alternative would be to use the OpenEdge .NET Open Client and generate compiled proxies that avoid dynamic invocation, but would require writing the UI code in C#. That would also require compiling .NET code into assemblies and deploying them with the OpenEdge application. However, even a .NET Open Client application will have marshaling and copying overhead as well as the AppServer communication overhead.

Complex forms (forms with hundreds of objects) would benefit by using proven techniques to lazily load some of its controls on initial load. The form could, for example, by using callable panels and initially collapsing all but one of its panels or by making use of a tab folder, explorer bar or some other layout mechanism.