0

I have a VB.NET application that on first loads takes about 5-10 seconds to show the first usercontrol, but quicker after that. This screen isn't overly complex but contains a few devexpress components. Throughout my reading online it seems the issues is due to the way that .NET compiles items at runtime.

There is an article on how to speed this up by compiling it all (https://www.devexpress.com/Support/Center/Question/Details/A2670) but it's an 11 year old article and most of it's relating to c# which I'm having trouble relating back to VB.NET

Has anyone had any experience on how to compile all the user controls so that their first load is quicker? (I know that 5-10 seconds may not seem slow, but that time is without any code on that form yet, and it causes the application to look like it's not responding during this time)

Filburt
  • 17,626
  • 12
  • 64
  • 115
Stephen Pefanis
  • 305
  • 1
  • 3
  • 16
  • That answer is perfectly valid and has nothing to do with C#. It is a general problem in JIT environments like NET. More info: http://stackoverflow.com/questions/5525082/jit-vs-ngen-what-is-the-difference and also http://stackoverflow.com/questions/716983/have-you-ever-used-ngen-exe – Steve Aug 02 '15 at 21:54
  • Agreed, the answer is valid and makes sense, but the examples i can find on the net are all relating to C#, which i am having trouble converting to functioning code in VB.NET – Stephen Pefanis Aug 02 '15 at 23:06
  • Sorry but I don't understand what's C# role here. NGEN is a sdk tool that allows ANY NET assembly to be pre-compiled and could be useful to reduce the delay when an assembly is brought in memory for the first time. This is the same for VB.NET or C# or whatever NET language because it works on the compilation product. The exe or the Dll – Steve Aug 02 '15 at 23:32
  • Alternatively, you could use a splashscreen to let the user know something is loading. Since you're using DevExpress, check out [WaitForm](https://documentation.devexpress.com/#WindowsForms/CustomDocument10824). – Saragis Aug 02 '15 at 23:35
  • @steve - I suppose the problem with the NGEN tool is that i am not able to find a good simple walkthrough to trail. I found some articles on the JIT items, but they were in c#, probably should have been a bit clearer within my original question – Stephen Pefanis Aug 03 '15 at 00:29
  • @saragis - I've looked into that, and it makes a good solution to the problem as it works well. Still a little curios as to how to achieve a solution by pre-compiling, but happy now that it at least tells the user whats happening – Stephen Pefanis Aug 03 '15 at 00:32

1 Answers1

-1

To update this for anyone else who is looking, The solution that I ended up using was to change my application solution platform to x86. This was done by opening the applications properties and in the "Compile" tab changed the "Platform" to have x86.

If this doesn't exist and only has "Any CPU" then click on "Build" (application menu at top) and then "Configuration Manager". Select under platform "New". Change the Platform the x86 and do not copy from anything. This will then have the new platform available within the "Compile" menu. This change sped my form startup from 10 seconds down to 2

I found the solution via the Devexpress site : https://www.devexpress.com/Support/Center/Question/Details/Q422245

Stephen Pefanis
  • 305
  • 1
  • 3
  • 16