Sí, es la utilidad NGen. Hasta donde se es muy complicado de implementar
porque la optimizacion llega a version de procesador.
En el libro CLR via C# (que no puedo dejar de recomendar fuertemente
para cualquiera que trabaje en .NET) Jeffrey Richter enumera varias
desventajas:
There are several potential problems with respect to NGen’d files:
■■ No intellectual property protection Many people believe that it might
be possible to ship
NGen’d files without shipping the files containing the original IL code,
thereby keeping their
intellectual property a secret. Unfortunately, this is not possible. At
run time, the CLR requires
access to the assembly’s metadata (for functions such as reflection and
serialization); this
requires that the assemblies that contain IL and metadata be shipped. In
addition, if the CLR
can’t use the NGen’d file for some reason (described next), the CLR
gracefully goes back to JIT
compiling the assembly’s IL code, which must be available.
■■ NGen’d files can get out of sync When the CLR loads an NGen’d file,
it compares a number
of characteristics about the previously compiled code and the current
execution environment.
If any of the characteristics don’t match, the NGen’d file cannot be
used, and the normal JIT
compiler process is used instead. Here is a partial list of
characteristics that must match:
• CLR version: This changes with patches or service packs.
• CPU type: This changes if you upgrade your processor hardware.
• Windows operating system version: This changes with a new service pack
update.
• Assembly’s identity module version ID (MVID): This changes when
recompiling.
• Referenced assembly’s version IDs: This changes when you recompile a
referenced
assembly.
• Security: This changes when you revoke permissions (such as
declarative inheritance, declarative
link-time, SkipVerification, or UnmanagedCode permissions), that were once
granted.
Pablo Pioli