D vs. C#

Don Clugston dac at nospam.com.au
Tue Oct 23 07:02:57 PDT 2007


Walter Bright wrote:
> Robert Fraser wrote:
>> Right now in-flight optimization rarely makes code that runs faster,
>> but it's a new technology. In 10 years, I'm guessing that most code
>> will run equally fast under a VM as native, and another 10 and the VM
>> will be superior. Especially as multi-core architectures become more
>> popular, I think this will be a big issue (since the VM can
>> automatically parallelize loops, etc.).
> 
> 2 years ago, I attended a Java seminar by a Java expert who predicted 
> that in 10 years, Java code would run as fast as C code. Since it's 
> still 10 years out, it must be like chasing a mirage <g>.

Deja moo! I've heard that bull before. <g>

I think the whole thing's a fallacy. The only real advantage I can see that a 
JIT compiler has, is in being able to inline dynamically loaded functions. It 
may also have some minor advantages in cache efficiency. (In both cases, this is 
actually an advantage of JIT linking, not JIT compilation).

In reality, speed optimization only matters inside the innermost loops, and you 
get the big speed gains by algorithm changes (even small ones). A JIT compiler 
would seem to have an inherent disadvantage whenever the bytecode contains less 
information than was created in the compiler's semantic analysis. This is 
certainly true of the Java/.NET bytecode, which is far too low level.




More information about the Digitalmars-d mailing list