I have noticed that when I install a new .NET program (using msi file) on a slow computer, this program needs a lot of time for its first execution. Once the first run is done, if I restart the same program, execution time is normal (even after restarting the computer). So, it seems that during the very first execution, some special treatment is done by the CLR.

Any ideas about the cause of this phenomenon ?

.NET programs aren't compiled to machine code as part of the assembly, they're in an intermediate state (IL assembly language) that the framework needs to compile into machine code. On the first run of an assembly, the just-in-time (JIT) compiler does all of that, which is why it's slower than subsequent executions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.