Re: optimized code




"Daniel O'Connell [C# MVP]" <onyxkirx@xxxxxxxxxxxxxxxxxxxxx> wrote in
message news:eNZ5Ljq%23FHA.1676@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Mike" <vimakefile@xxxxxxxxx> wrote in message
> news:Oj7acNp%23FHA.2424@xxxxxxxxxxxxxxxxxxxxxxx
>> Is it still true that the managed C++ compiler will produce much better
>> opimizations than the C# compiler, or have some of the more
>> global/aggressive opimizations been rolled into the 2005 compiler?
>>
>
> Yes, the Managed C++ compiler should still be better. the C# compiler
> still doesn't go very far as far as optimizations go, AFAIK anyway. They
> are left to the JIT.
>
>
The same applies to the "managed C++" compiler, common sub-expressions and
loop invariants are handled by the JIT not by the compiler fron-ends.
The managed C++ compiler generates IL, sometimes it does a better job, but
I've seen IL code that was better optimized by the C# compiler. Anyway the
differences are < 5% (both sides), MS said that they will focus on the JIT
to further optimize, not in the C++ front-end.


Willy.


.



Relevant Pages

  • Re: optimized code
    ... > loop invariants are handled by the JIT not by the compiler fron-ends. ... generates the best optimized MSIL of any of the .NET languages. ... standard native code optimizations on MSIL code. ...
    (microsoft.public.dotnet.languages.csharp)
  • misc: lang effort, performance
    ... I added a define that allowed me to enable/disable ref counting to see what ... a c implementation of the algo takes about 110ms (generic compiler options). ... I had started to consider the possibility of jit compilation. ... of course, thinking of it, some optimizations (those which I had originally ...
    (comp.lang.misc)
  • Re: optimized code
    ... All depends on what exactly you are measuring, how you are comparing and ... produced by the C++ compiler, when enabling max. optimizations (enables the ... > "Floating Point?The v1 JIT does not currently perform all the FP-specific ... > optimizations that the VC++ backend does, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# and compiler optimizer.
    ... letting you specify inlining? ... A JIT can just start by running the optimizations a traditional compiler would do. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: optimized code
    ... the Managed C++ compiler should still be better. ... > are left to the JIT. ... I assume the JIT is limited to peephole optimizations? ... If I have an inner loop of something like: ...
    (microsoft.public.dotnet.languages.csharp)

Loading