PC Review


Reply
Thread Tools Rate Thread

Format of .NET assemblies

 
 
=?Utf-8?B?UmF2aQ==?=
Guest
Posts: n/a
 
      23rd May 2005
Hi,

I have few questions about the format of .NET assemblies:

Are all .NET assemblies created in Portable Executable (PE) format only or
is there any other format supported? If so, which format gives better
performance?

Is Common Object File Format (COFF) related to .NET assemblies?

Thanks in advance,
Ravi.
 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      23rd May 2005

>Are all .NET assemblies created in Portable Executable (PE) format only or
>is there any other format supported?


If you target 64-bit platforms they can also be in PE+/PE64, if you
count that as a separate format.


>Is Common Object File Format (COFF) related to .NET assemblies?


Yes, since it's related to PE.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
=?Utf-8?B?UmF2aQ==?=
Guest
Posts: n/a
 
      24th May 2005
Hi,

Thanks for the reply.

From my understanding, the code in PE format is the MSIL. During execution,
the JIT compiler converts MSIL to native code and executes it. Is there a way
to pre-convert MSIL into native code to avoid runtime overhead?
What is the format in which the native code is stored? (is it COFF even for
managed code also?)

Thanks,
Ravi.

"Mattias Sjögren" wrote:

>
> >Are all .NET assemblies created in Portable Executable (PE) format only or
> >is there any other format supported?

>
> If you target 64-bit platforms they can also be in PE+/PE64, if you
> count that as a separate format.
>
>
> >Is Common Object File Format (COFF) related to .NET assemblies?

>
> Yes, since it's related to PE.
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
>

 
Reply With Quote
 
Richard Blewett [DevelopMentor]
Guest
Posts: n/a
 
      24th May 2005
Well you can run NGEN.EXE on the assembly on the deployment machine - this will cache a native image ono the disk.

Is this an overhead you are theoretically worried about or do you have evidence that JIT compilation is cauing you problems in your environment? NGEN doesn't come for free, there are also downsides to using it in 1.x (although some of these have been resolved with NGEN v2.0)

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi,

Thanks for the reply.

From my understanding, the code in PE format is the MSIL. During execution,
the JIT compiler converts MSIL to native code and executes it. Is there a way
to pre-convert MSIL into native code to avoid runtime overhead?
What is the format in which the native code is stored? (is it COFF even for
managed code also?)

 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      24th May 2005
You could use the "ngen" to compile your MSIL code. It could perhaps save a
bit especially at startup...

Other than that it's likely that the algoirhtms used will likely influence
much more the performance than the file format....

Patrice

--

"Ravi" <(E-Mail Removed)> a écrit dans le message de
news:CF36958B-DB39-494C-B482-(E-Mail Removed)...
> Hi,
>
> I have few questions about the format of .NET assemblies:
>
> Are all .NET assemblies created in Portable Executable (PE) format only or
> is there any other format supported? If so, which format gives better
> performance?
>
> Is Common Object File Format (COFF) related to .NET assemblies?
>
> Thanks in advance,
> Ravi.



 
Reply With Quote
 
=?Utf-8?B?UmF2aQ==?=
Guest
Posts: n/a
 
      24th May 2005
Hi,

There is no evidence that JIT causes problems, but it is a theoretical
assumption that if we run a native executable, it would run faster.
Are there any problems with using NGEN.exe?

Thanks,
Ravi.

Are there any
"Richard Blewett [DevelopMentor]" wrote:

> Well you can run NGEN.EXE on the assembly on the deployment machine - this will cache a native image ono the disk.
>
> Is this an overhead you are theoretically worried about or do you have evidence that JIT compilation is cauing you problems in your environment? NGEN doesn't come for free, there are also downsides to using it in 1.x (although some of these have been resolved with NGEN v2.0)
>
> Regards
>
> Richard Blewett - DevelopMentor
> http://www.dotnetconsult.co.uk/weblog
> http://www.dotnetconsult.co.uk
>
> Hi,
>
> Thanks for the reply.
>
> From my understanding, the code in PE format is the MSIL. During execution,
> the JIT compiler converts MSIL to native code and executes it. Is there a way
> to pre-convert MSIL into native code to avoid runtime overhead?
> What is the format in which the native code is stored? (is it COFF even for
> managed code also?)
>
>

 
Reply With Quote
 
Richard Blewett [DevelopMentor]
Guest
Posts: n/a
 
      24th May 2005
An NGEN'd assembly will not run faster except at start up (code is only JIT'd once per program executing).

However, in 1.1 NGEN code *may* run slower as the runtime has to load both the native version and the IL version as the IL version contains the metadata the runtime needs to provide alot of the services it does. Because of the impact on working set, the program may, therefore have more paging taking place and so run slower. In addition, NGEN'd assemblies are "fragile" in that if any dependency changes the runtime must assume that any inlined methods may now be invalid and so reverts back to JITing.

However, Windows likes to share code images across processes which it cannot do with JIT'd code so NGEN can give an advantage there - but this depends on you NGENing an image that is used by alot of processes.

Version 2.0 puts the metadata in the native image to resolve the double load issue and has a background process that re-NGENs native assemblies that have been "broken" by dependency changes. So under version 2.0 NGEN is much morfe compelling. However, as with all performance optimizations make sure you test that it has helped before you go into production with it.

NGEN can help speed up start up time but won't necessarily.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi,

There is no evidence that JIT causes problems, but it is a theoretical
assumption that if we run a native executable, it would run faster.
Are there any problems with using NGEN.exe?

Thanks,
Ravi.

Are there any
"Richard Blewett [DevelopMentor]" wrote:

> Well you can run NGEN.EXE on the assembly on the deployment machine - this will cache a native image ono the disk.
>
> Is this an overhead you are theoretically worried about or do you have evidence that JIT compilation is cauing you problems in your environment? NGEN doesn't come for free, there are also downsides to using it in 1.x (although some of these have been resolved with NGEN v2.0)


 
Reply With Quote
 
=?Utf-8?B?Q3Jpc3RpYW5Nb3Jp?=
Guest
Posts: n/a
 
      15th Jul 2005
Well, I don't think that at runtime you'll see any difference. I remember
reading some white paper from nasa (or some org like that) showing with a
math benchmark that the managed code is as fast as the native one, and
sometime maybe is faster!

"Patrice" wrote:

> You could use the "ngen" to compile your MSIL code. It could perhaps save a
> bit especially at startup...
>
> Other than that it's likely that the algoirhtms used will likely influence
> much more the performance than the file format....
>
> Patrice
>
> --
>
> "Ravi" <(E-Mail Removed)> a écrit dans le message de
> news:CF36958B-DB39-494C-B482-(E-Mail Removed)...
> > Hi,
> >
> > I have few questions about the format of .NET assemblies:
> >
> > Are all .NET assemblies created in Portable Executable (PE) format only or
> > is there any other format supported? If so, which format gives better
> > performance?
> >
> > Is Common Object File Format (COFF) related to .NET assemblies?
> >
> > Thanks in advance,
> > Ravi.

>
>
>

 
Reply With Quote
 
AlexS
Guest
Posts: n/a
 
      15th Jul 2005
You can start from here

http://msdn.microsoft.com/msdnmag/is...E/default.aspx

HTH
Alex

"CristianMori"
<REMOVEcristian.mori@NO_SPAM_PLEASEtechint.itREMOVE_THIS_ALSO> wrote in
message newsD6F40E0-CE70-44C1-BE0C-(E-Mail Removed)...
> Well, I don't think that at runtime you'll see any difference. I remember
> reading some white paper from nasa (or some org like that) showing with a
> math benchmark that the managed code is as fast as the native one, and
> sometime maybe is faster!
>
> "Patrice" wrote:
>
> > You could use the "ngen" to compile your MSIL code. It could perhaps

save a
> > bit especially at startup...
> >
> > Other than that it's likely that the algoirhtms used will likely

influence
> > much more the performance than the file format....
> >
> > Patrice
> >
> > --
> >
> > "Ravi" <(E-Mail Removed)> a ecrit dans le message de
> > news:CF36958B-DB39-494C-B482-(E-Mail Removed)...
> > > Hi,
> > >
> > > I have few questions about the format of .NET assemblies:
> > >
> > > Are all .NET assemblies created in Portable Executable (PE) format

only or
> > > is there any other format supported? If so, which format gives better
> > > performance?
> > >
> > > Is Common Object File Format (COFF) related to .NET assemblies?
> > >
> > > Thanks in advance,
> > > Ravi.

> >
> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Large assemblies/fewer quantity or Smaller assemblies/Larger quantities. milop Microsoft Dot NET Framework 0 26th Mar 2010 09:05 PM
How to Deploy WinSxS assemblies as Private assemblies? immi Microsoft VC .NET 2 4th May 2009 11:00 AM
System.Type.GetCommonAttributes() works on c# assemblies, not managed c++ assemblies. brad Microsoft Dot NET Framework 1 4th Mar 2007 03:43 PM
Loading resources from satellite assemblies of reflection loaded assemblies.. npthomson@gmail.com Microsoft C# .NET 0 23rd Nov 2006 06:08 PM
Format of .NET assemblies =?Utf-8?B?UmF2aQ==?= Microsoft Dot NET 2 24th May 2005 12:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:14 PM.