You are here: Re: PHP compared to Java/J2EE « PHP Programming Language « IT news, forums, messages
Re: PHP compared to Java/J2EE

Posted by Jerry Stuckle on 11/16/07 18:19

Lew wrote:
> 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.
>

First of all, I understand what you say about large scale systems. But
part of the performance gain comes from the relatively easy means of
multithreading in Java. It's harder in C++, but can be done. However,
having to deal with shared memory, etc., makes things slower.

I agree that some C++ compilers don't do a good job allocating memory;
but at the same time I've seen some very poorly written C++ programs.
Ones where some relatively simple work would make it run significantly
faster. And quite frankly, some of the C++ libraries I've seen out
there are written so poorly it's a wonder you get any performance out of
them at all. Many of Java's classes (especially the UI's) are typically
more efficient in that many C++ class libraries.

Uptime is a non-point. Either one can have 100% uptime. Throughput is
one measurement used. However, CPU load is another, especially when it
comes to large systems. And Java typically requires more CPU cycles to
do the same job than a compiled language does (again, if both are
optimized). If that's the only job running, then yes, Java can
outperform C++ if the C++ program is single threaded. However, get a
heavily loaded CPU, and Java will typically slow down more quickly than C++.

Now please don't get me wrong. I am NOT bashing Java. I use it, and at
one time was Sun Certified in it (just never kept up the certification).
And I agree it is a good programming language. But it is not the
answer to life, the universe and everything.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация