D vs. C#

Robert Fraser fraserofthenight at gmail.com
Mon Oct 22 13:22:13 PDT 2007


Dave Wrote:

> > One possibility is to do profiling while the application is running and do 
> > further optimizations based on that. The questions are, is the VM 
> > performance hit worse than the optimizations, and is there a compelling 
> > reason not to do those optimizations always?
> 
> That's what Sun Hotspot does, but I've rarely seen where the results are 
> better than what a static compiler w/ the "-O2" switch can do and often seen 
> where they are worse. IIRC (for example) the Jet "Ahead of Time" Java 
> compiler can often outperform the Sun VM.
> 
> Not that all this really matters for *most* code however, where just 
> compiling to native code is a big enough win. But I have seen the old 80-20 
> rule at work -- cases where 80% of the time is spent on 20% of the code 
> trying to make it run faster -- so it's not a moot point either.

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.).



More information about the Digitalmars-d mailing list