Release versus Debug builds in C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jan

    Release versus Debug builds in C#

    Greetings,

    I recently switched from a Debug version of code to a
    release version of code. I checked to see that /optimize
    was set for Release. After comparing the two versions of
    code for execution speed, I must confess I didn't see much
    improvement. Does anyone have an idea of how efficient
    the optimization is for the C# compiler and what it does
    (more specificially than size speed, etc, which is sited
    in the help files)

    Thanks very much!
  • Alvin Bruney

    #2
    Re: Release versus Debug builds in C#

    The improvement should be in size of assembly which corelates to page faults
    during runtime. Smaller assemblies cause less page faults (hard or soft) All
    things considered. This is a general statement not an absolute, so nobody be
    yelling at me.

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "Jan" <anonymous@disc ussions.microso ft.com> wrote in message
    news:050201c39e 78$76528710$a40 1280a@phx.gbl.. .[color=blue]
    > Greetings,
    >
    > I recently switched from a Debug version of code to a
    > release version of code. I checked to see that /optimize
    > was set for Release. After comparing the two versions of
    > code for execution speed, I must confess I didn't see much
    > improvement. Does anyone have an idea of how efficient
    > the optimization is for the C# compiler and what it does
    > (more specificially than size speed, etc, which is sited
    > in the help files)
    >
    > Thanks very much![/color]


    Comment

    • Grant Richins [MS]

      #3
      Re: Release versus Debug builds in C#

      The compiler really doesn't do a lot of optimizations, instead most of the
      optimizations happen at runtime with the JIT. You can easily see the
      differences in the compiler generated IL by using the SDK tool ildasm.exe
      and then comparing the IL (think of it like java byte codes or a high-level
      pseudo-assembly language). One common mistake when testing/checking
      performance of 'optimized' code, is to run it under the debugger. When
      running under the debugger, by default the JIT generates slow, more
      debuggable code even if the optimize option was used. I know there's a way
      to force it to generate optimizable code, but I can't find it at the moment.

      --
      --Grant
      This posting is provided "AS IS" with no warranties, and confers no rights.


      "Jan" <anonymous@disc ussions.microso ft.com> wrote in message
      news:050201c39e 78$76528710$a40 1280a@phx.gbl.. .[color=blue]
      > Greetings,
      >
      > I recently switched from a Debug version of code to a
      > release version of code. I checked to see that /optimize
      > was set for Release. After comparing the two versions of
      > code for execution speed, I must confess I didn't see much
      > improvement. Does anyone have an idea of how efficient
      > the optimization is for the C# compiler and what it does
      > (more specificially than size speed, etc, which is sited
      > in the help files)
      >
      > Thanks very much![/color]


      Comment

      Working...