Re: optimized code




"Daniel O'Connell [C# MVP]" <onyxkirx@xxxxxxxxxxxxxxxxxxxxx> wrote in
message news:eNZ5Ljq%23FHA.1676@xxxxxxxxxxxxxxxxxxxxxxx
>
> 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.

Thanks. Well, I guess I don't care if the compiler does the magic, or the
JIT.
I assume the JIT is limited to peephole optimizations? Does the JIT handle
common sub-expression removal, loop invarients, etc?

If I have an inner loop of something like:
for ( i ...) {
a.b.c.x = ...
a.b.c.y = ...
a.b.c.arr[i] =
...
}

Do I need to put a.b.c in a local outside the loop, or will the JIT take
care of this?
Sometimes it's cleaner to code this way, sometimes not - but there's also
auto-generated code, and whether I need to generate code with temps.

thanks



.



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: Bugs at my web site
    ... > an array bounds violation has occured and breaking if it has isn't ... The only question is for JIT compilers. ... Consider a constant loop, or a loop with the limit equal to the ... The JIT compiler can also test for a try/catch block and only generate ...
    (comp.lang.fortran)
  • 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)

Quantcast