Board index » delphi » Precompiled .NET code(?)

Precompiled .NET code(?)


2003-11-10 01:06:15 AM
delphi75
If I understand it correctly the .NET code is compiled into native machine
code when it is loaded from the disk into memory. Is it possible to have the
.NET code precompiled for a specific platform? This would prevent any
compilation at runtime which would make apps start faster; and since the
precompiled code would be machine code we wouldn't need any obfuscators,
right? Of course this would make deployment more difficult, but it could
give peace of mind to those who fear that their IP algorithm might be
copied...
(just a thought)
 
 

Re:Precompiled .NET code(?)

Well, a couple of things.
For addressing the start-up time issue (mainly), the .NET framework actually
does have a utility, NGen, for generating native images (i.e. pre-compiling)
assemblies.
However, even pre-compiled assemblies like that (must) contain all the meta
data, including the IL code. that is because NGen'ed images only work with
the exact same referenced assemblies that existed when the image was
generated. If something changes on the system that affects the referenced
assemblies, the framework must be able to fall back to JIT'ing the code.
- Per
 

Re:Precompiled .NET code(?)

Quote
For addressing the start-up time issue (mainly), the .NET framework
actually
does have a utility, NGen, for generating native images (i.e.
pre-compiling)
assemblies.
Cool...
Quote
However, even pre-compiled assemblies like that (must) contain all the
meta
data, including the IL code. that is because NGen'ed images only work with
the exact same referenced assemblies that existed when the image was
generated. If something changes on the system that affects the referenced
assemblies, the framework must be able to fall back to JIT'ing the code.
Well... this is only a good start. What I thinking was a snapshot of the
compiled code in memory; so that no IL code would be needed -- assuming that
the in-memory compiled code is stripped of any meta data... If something
changes in the system and the compiled .NET has problems running then it
would/should fail...
Would this be done in the future?
 

Re:Precompiled .NET code(?)

On Sun, 9 Nov 2003 12:06:15 -0500, <"Peter Zolja" <csu10711 [at]
mail.claytonstate.net>>said ...
Quote
If I understand it correctly the .NET code is compiled into native machine
code when it is loaded from the disk into memory.
The IL code is only compiled when it is used, so if you never use a
routine it the runtime will not waste it is time compiling it. Also the
runtime can throw away the compile code if it needs the memory for
something else (The .NET 1.1 Runtime doesn't implement this)
Marc