How to accelerate .NET assembly loading performance

We have a product that contains about 50 assemblies (DLL files), most of which are required and loaded when the main executable file starts. The result is even on a medium-speed machine , The load time of the component and the load time of the JIT also take 2-3 seconds, which is an unacceptable overhead in our case.

If we load the program once and still from the same If you run multiple times in the executable file, the time starts from a few milliseconds. But for end users, this is not an option, they will run it from the command line.

I want to do it the first time Speed ​​up loading when instantiating executable files. There is a small speedup between cold boot (after restarting Windows) and warm boot, but only a slight increase. What techniques or tools can we use to speed up loading (note: we try Through ILMERGE, it can only help about 30%, NGEN is not an option, it needs to run on various systems and architectures).

I am considering creating a service and/or a specific CLR hosting environment , But hope there is a simpler and simpler solution. I have not tried GAC.

Use NGEN and multi-core JIT. Refactor your application so that fewer assemblies and less code are required at startup. Use ILMerge to reduce the number of assemblies and even delete some unused code.

All of these are optimizations you can make. They do not provide breakthrough improvements. .NET has no such option.

See how DevArt Code Compare does this: They let the comparison app always run because it does take a few seconds to start it.

Let the app always run in the background. When starting from the command line, just forward the command to a background process that is already running And forward the results. This makes the command line application small and quick to start. It certainly does not require 50 components to be loaded.

This is probably the best you can do because it almost completely eliminates Start.

We have a product that contains about 50 assemblies (DLL files), most of which are required and loaded when the main executable file starts. The result is even On a medium-speed machine, the component load time and JIT load time also take 2-3 seconds, which is an unacceptable overhead in our case.

If we load the program once And run multiple times from the same executable file that is still running, the time starts from a few milliseconds. But for the end user, this is not an option. They will run it from the command line.

I want to speed up the loading when the executable is instantiated for the first time. There is a small speedup between a cold boot (after restarting Windows) and a warm boot, But only slightly increased. What technologies or tools can we use to speed up loading (Note: We have tried ILMERGE, it can only help about 30%, NGEN is not an option, it needs to run on various systems and architectures). /p>

I am considering creating a service and/or a specific CLR hosting environment, but hope there is a simpler and simpler solution. I have not tried GAC.

Use NGEN and multi-core JIT. Refactor your application so that it requires fewer assemblies and less code at startup. Use ILMerge to reduce the number of assemblies, or even delete Some unused code.

All of these are optimizations you can make. They do not provide breakthrough improvements. .NET does not have such an option.

Look at How DevArt Code Compare does this: They make the comparison application always run, because it does take a few seconds to start it.

Let the application always run in the background. When starting from the command line, just add The command is forwarded to a background process that is already running and the results are forwarded. This makes the command line application small and can be started quickly. It certainly does not require 50 components to be loaded.

This is probably the best you can do Okay, because it almost completely eliminates startup.

Leave a Comment

Your email address will not be published.