D vs VM-based platforms

gareis dhasenan at gmail.com
Mon Apr 30 21:43:14 PDT 2007


Sean Kelly wrote:
...
> That said, JIT optimization is still a relatively new practice, and with 
> more cores being added to computers these days it's entirely possible 
> that a JIT optimizer could run on one or more background CPUs and do 
> much better than today.

And then you're sacrificing two or three cores to run one thread, rather 
than sacrificing most of the developer's computational power at compile 
time and running as efficiently (or more so) with at most one core per 
thread.

Now, if the compiler cached its optimizations on disk, you could 
potentially get similar optimizations after some large number of runs. 
However, in the interim the program would run slower than the optimized 
precompiled code, and would start slower than the JIT code that didn't 
cache its optimizations (because that caching takes disk time, and 
that's one of the most expensive resources).

Of course, your runtime compiler can optimize for your user's current 
CPU, even if that changes. I suppose you could create binaries optimized 
for each CPU and have a script determine which is appropriate for the 
current CPU, but that's spending disk space (also quite scarce) in 
exchange for CPU time (relatively abundant).

I don't know how to solve this problem, but it's an interesting one.



More information about the Digitalmars-d mailing list