Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
455
WinGrid: Performance issue
posted

Hi,

I have a WinForms MDI application with certain forms with UltraWinGrid, I am having a perform issue with application as described below

Suppose, I have three winforms form1.cs, form2.cs and form3.cs and all of them have ultrawingrid control.

when I run the application and access form1 it will take little longer to load but once loaded, if I access form2 or form3 (which also have ultrawingrid) will load normally, now if I close the application and access form2 first it will take longer but once loaded form1 and form3 will load normally.

So what I observed is that, any time winforms application have ultrawingrid, the ultrawingrid assembly (and related assemblies) is not loaded until it is first referenced hence the time is spent by cpu to load the assembly. Is there any way to pre-load ultrawingrid assembly (in a splash form, during application startup or through config file) so that performance hit can be reduced when form is first time referenced.

 

I hope this is clear.

 

Thanks,

 

 

  • 469350
    Suggested Answer
    Offline posted

    Hi,

    This has all the hallmarks of a JITting issue. The first time your application references an assembly, any assembly, the DotNet Framework has to load that assembly into memory. And this can cause a slowdown in your application. The fact that loading a second form with a grid is much faster is a strong indication that this is the issue. The second form loads faster, because the assemblies are already loaded.

    The only way to get around something like this is to pre-JIT your assemblies on the user's machines. You can do that with a utility that comes with the DotNetFramework called nGen. So you might want to check online or on Microsoft's documentation for nGen.exe and it's use.