Re: PHP compared to Java/J2EE
Jerry Stuckle wrote:
Lew wrote:
Sanders Kaufman wrote:
And yet - PHP is *constantly* used for large, successful projects -
while
Java sites are pretty much limited to pretty pinball games and such.
Nearly every agency in the U.S. Federal government uses Java for their
enterprise servers.
A large number also use PHP. Java isn't the only language used.
A host of major health-care firms do likewise.
Ditto.
IBM makes a fortune with WebSphere. BEA remains in business despite
having been founded before the 2001 dot-bomb. How's Oracle doing lately?
It's a lot to you and me, but a drop in the bucket to IBM. And Zend
Studios doesn't try to make a fortune with PHP - rather, they give it
away - even the source.
And IBM makes a lot more money off of CICS than it does WebSphere.
Sun's change of stock ticker symbol to "JAVA" was immediately followed
by a bump in their stock prioe.
So? What does it prove? A change in a stock symbol often causes a
change in the stock price.
Java remains by recent surveys the most "popular" language in
professional use, slightly up from last year.
Who's survey? And define "professional use".
This is not necessarily evidence of Java's suitability, let alone
superiority, only that it's widely used, and in quite serious projects
that do not involve "pinball games and such", let alone pretty ones.
I don't think anyone ever argued that Java isn't widely used. But so is
PHP, C, C++, COBOL...
Or was that comment simply BS thrown out to inflame?
In fact, Java has many features that make it suitable for enterprise
systems. Being a strongly-typed, compiled language with runtime
performance that equals or exceeds native-code statically compiled
systems (C, C++), the extremely strong tools support with a broad base
of well-funded suppliers proffering a healthy smorgasbord of choices,
a large labor supply of trained practitioners and inherent support for
distributed, heterogeneous programming make it a match for the kind of
complex edifices needed in that market.
I have yet to see Java equal the performance of any decently-written C
or C++ program. Not to say that there aren't other things going for it
- there definitely are. But performance is NOT one of them.
And yet the current crop of benchmarks consistently place Java runtime speed
in the same ballpark as C++ programs.
Jake2 achieves pretty high frame rates, and that's with Java graphics which
always are going to be slower, just not by nearly as much as people suppose.
When it comes to CPU computations and other operations typical of many
application mixes we find Java systems equaling or exceeding the performance
of statically-compiled languages. This is in part because of garbage
collection - C++ programs have been measured as spending 25-30% of their
execution profile in allocation and deallocation. Java's techniques are much
faster than most C++ allocation strategies.
<http://www.ibm.com/developerworks/java/library/j-jtp09275.html?S_TACT=105AGX02&S_CMP=EDU>
<http://www-128.ibm.com/developerworks/library/j-jtp01274.html>
<http://www.idiom.com/~zilla/Computer/javaCbenchmark.html>
The age of these articles points to how long the urban legend of Java's
supposed slowness has been debunked.
JVMs for Java 5 and 6 are far ahead of earlier versions for performance.
<http://java.sun.com/performance/reference/whitepapers/6_performance.html>
Here's a recent link that favors C++:
<http://bruscy.multicon.pl/pages/przemek/java_not_really_faster_than_cpp.html>
Notice that here the performance gap is much lower than people suppose - about
2.5:1 overall. And that included JVM load time!
This is a bit of an unfair advantage to C++. No one denies that Java takes a
while to load, and its optimization profile is run-time tuned, not static.
That means you don't get optimal performance from a Java program until it's
been running for a while. We have to make sure that we aren't saying a
sprinter is a better runner than a marathoner because our test race is 100
meters long.
We can say it's better to put the sprinter in the dash and the marathoner in
the long-distance race.
When benchmarks compare longer-running processes like server systems, we find
that Java actually outperforms C++.
Even so, there's a need to consider results like:
<http://blogs.sun.com/dagastine/entry/sun_java_is_faster_than>
(linked via
<http://blogs.sun.com/teera/entry/java_performance_benchmark_roundup>
)
Remember, too, that we're talking about large-scale systems, for many Java
shops. There is an awful lot of multi-processing, multi-threading,
inter-process communication (IPC), XML, security and certificates and stuff
like that going on. Such systems typically measure performance as throughput
and uptime.
--
Lew