Re: Can you write code directly in CIL ???
- From: "Peter Olcott" <olcott@xxxxxxx>
- Date: Wed, 28 Dec 2005 10:31:32 -0600
"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:O%23d6lF5CGHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Peter Olcott" <olcott@xxxxxxx> wrote in message
> news:egksf.38007$QW2.25703@xxxxxxxxxxxxx
>>
>> "Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
>> news:MPG.1e1b84c73d78be9098cbe4@xxxxxxxxxxxxxxxxxxxxxxx
>>> Nicholas Paldino [.NET/C# MVP] <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>>> I will second that the C++ compiler is better at optimizing IL output
>>>> than the C# compiler. However, as Willy stated, it will not always produce
>>>> verifiable code... I believe the article you were looking for is in MSDN
>>>> magazine.
>>>
>>> No, the article was definitely someone posting in this group saying, "I
>>> want to be able to embed IL in my C# code, here's why." He then
>>> produced some better IL (which I suspect *was* verifiable) which the C#
>>> compiler "could" have produced from the source C# (i.e. the behaviour
>>> was identical).
>>>
>>> I'm sure this will improve over time, but to be honest it's usually the
>>> JIT that has more to do with optimisation IMO.
>>
>> I wouldn't think that this would be the case for two reasons:
>> (1) CIL (for the most part) forms a one-to-one mapping with assembly language
>
> Not true, IL is kind of high level language compared to X86 assembly, one
> single IL instruction translates to x assembly level instructions where x is
> certainly not 1.
Many of the instructions (all the ones in my critical 100 line function) would
map one-to-one with assembly language. All of the code in this critical 100 line
function is comparisons, branches, and the data movement of single integers.
>
>> (2) End users are waiting on the JIT to complete, no time to waste doing
>> optimizations that could have been done before the softwae shipped.
>>
>
> Wrong again, IL is not optimized that much, THE optimizer is the JIT. It's
The JIT probably does all the processor specific optimizations. These don't
affect performance nearly as much as the ones that are not processor specific.
> the JIT that knows at run-time what kind of optmizations can be performed
> depending on the characteristics of the HW like CPU type 32bit/64 bit, number
> of registers, L1 and L2 cache sizes, MMX/SSE enabled etc.
> The CLR is a run-time optimizing execution engine, whether you believe it or
> not.
>
>
> Willy.
>
>
.
- Follow-Ups:
- Re: Can you write code directly in CIL ???
- From: Willy Denoyette [MVP]
- Re: Can you write code directly in CIL ???
- References:
- Can you write code directly in CIL ???
- From: Peter Olcott
- Re: Can you write code directly in CIL ???
- From: Abubakar
- Re: Can you write code directly in CIL ???
- From: Jon Skeet [C# MVP]
- Re: Can you write code directly in CIL ???
- From: Abubakar
- Re: Can you write code directly in CIL ???
- From: Jon Skeet [C# MVP]
- Re: Can you write code directly in CIL ???
- From: Abubakar
- Re: Can you write code directly in CIL ???
- From: Jon Skeet [C# MVP]
- Re: Can you write code directly in CIL ???
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Can you write code directly in CIL ???
- From: Jon Skeet [C# MVP]
- Re: Can you write code directly in CIL ???
- From: Peter Olcott
- Re: Can you write code directly in CIL ???
- From: Willy Denoyette [MVP]
- Can you write code directly in CIL ???
- Prev by Date: How to get a random long number ?
- Next by Date: Re: playing mpeg4 or displaying jpegs using C#
- Previous by thread: Re: Can you write code directly in CIL ???
- Next by thread: Re: Can you write code directly in CIL ???
- Index(es):
Relevant Pages
|
Loading