Disgraceful Tradeoffs
Posted Mar 4, 2004 5:10 UTC (Thu) by
ncm (subscriber, #165)
In reply to:
IBM urges Sun to make Java open source (News.com) by lmartelli
Parent article:
IBM urges Sun to make Java open source (News.com)
Execution of Java programs on Free Software systems has long suffered from the inadequacy of the JVMs available. Some of these inadequacies are incidental, and might someday be fixed. Others arise directly from the language definition, making it impossible to optimize as fully as if source code were available. The language itself interferes with optimization, as well, so that Gcj (which compiles to native code) cannot optimize as well as a good (e.g.) C++ compiler can.
Surely you've noticed that your programs run much more slowly than the equivalent C++ program? Doesn't running half as fast, achieving half as many transactions-per-second, taking twice as long to finish, costing twice as much, or needing twice the processing power, count as crippled?
But there's more. The language's cargo-cult design makes any program written in Java substantially longer and more full of "noise" text than in a more thoughtfully-designed language. Its exception apparatus adds enormously to the textual overhead needed to handle errors, without making programs correspondingly more robust or simple to maintain. Its enforced garbage collection means that you have little control over the memory management, and general resource management, needed to tune performance and compensate for the poor low-level performance of the JVM. The garbage collection interferes with cache locality, so that programs often run from main memory instead of from cache, at an enormous speed penalty.
How closely are these flaws tied to the requirement to deliver machine independent binaries? How much is just bad design, how much immature implementation, and how much is fundamental to the goal? It doesn't matter much: absent the requirement, the flaws do not arise.
(
Log in to post comments)