There is a minor-war going on in Sun Alumni mailing list and elsewhere where the common misconception: “Java is slow” is surfacing again and again, much to the dismay of knowledgeable Java developers who have known for ages that Java is fast even compared to C++ and has been so for several years.マイナーには、太陽の卒業生で戦争が続いているメーリングリストや他のは、ありがちな誤解: " Javaは遅い"が浮上何度も繰り返して、非常に残念な知識をジャワの開発者whoが知られても年齢に比べてJavaが速いC + +としてきたので、数年前です。 All this re-surfaced because Sun decided toこのため、太陽のすべての裁定を再浮上 change its ticker symbol to JAVAティッカーシンボルを変更するにはジャワ (previously it was SUNW). (以前は次のことがsunw ) 。 All of this is terribly frustrating to Java developers who take pride in Java and are well aware of its capabilities because they leverage it every day.これは非常にイライラするのすべてのJava開発者をwhoに誇りを持って、 Javaとは十分承知してその機能を活用するため、彼らは毎日です。 So let’s rest this myth to rest once and for all, shall we?それでは、この神話を残りのすべての残りをきっぱりと、わたしたちですか?


Myth 1: Java is Interpreted language and so it must be slow神話1 : Javaは言語と解釈しなければならないので、遅い

Java is currently just-in-time-compiled by the JVM (Java virtual machine). Javaは現在、 ジャストインタイムコンパイルされて、 JVM ( Java仮想マシン)です。 Just-in-time-compilation gives it equivalent performance to compiled applications, sometimes better.ジャストインタイム-コンパイルは、これと同等の性能をコンパイルしたアプリケーションを、時には良いです。 Sun’s JIT is not the only one either.太陽のいずれか1つだけではないのJITです。 IBM and others provide their implementation of JVM with just-in-time-compilation too. IBMとその他のJVMの実装を提供してジャストインタイム-コンパイルが判明しました。

You can also compile Java programs in native executables with free compilers like gcj ( http://gcc.gnu.org/java/ ) or paid ones like Excelsior JET ( http://www.xlsoft.com/en/products/jet/index.html ). Javaプログラムをコンパイルすることもできます。 ネイティブ実行可能ファイルのような無料のコンパイラgcjのおかげで( http://gcc.gnu.org/java/ )または有料Excelsior JETのようなもの( http://www.xlsoft.com/en/products/jet / index.html )をします。

Java’s slowness is not intrinsic, that is an architectural mis-conception as demonstrated above. Javaの遅さではない固有の、その概念としては、実証建築上のミスです。 But wait there’s more..しかし、それだけで待つ..

Java versus C++ Benchmarksジャワ対C + +のベンチマーク

Let’s look at some benchmarks comparing Java with C++.いくつかのベンチマーク比較を見てみましょう、 JavaとC + +のです。

Performance of Java versus C++ by JPLewis and Ulrich Neumann from Computer Graphics and Immersive Technology Lab, University of Southern CaliforniaパフォーマンスのJava対C + +とjplewisとウルリッヒノイマンからコンピュータグラフィックスと没入型技術研究室では、南カリフォルニア大学

http://www.idiom.com/~zilla/Computer/javaCbenchmark.html http://www.idiom.com/ 〜 zilla /コンピュータ/ javacbenchmark.html

This article from 2003 finds “This article surveys a number of benchmarks and finds that Java performance on numerical code is comparable to that of C++ , with hints that Java’s relative performance is continuing to improve.この記事は2003年から見つかった"この記事は、いくつかのベンチマーク調査と認めるにJava の性能を数値コードが似通っていることに C + +で 、ヒントをJavaの相対的パフォーマンスが継続的に向上させる。 We then describe clear theoretical reasons why these benchmark results should be expected.”次に説明する明確な理論上の理由から、これらのベンチマーク結果はなぜ必要が見込まれること。 "

I would like to quote even further as they gave a detailed explanation about the slowness myth of Java and dispels it thoroughly:をお伝えしたいと彼らはさらに詳細な説明については、神話の遅さに徹底的に、 Javaとdispels :

Conclusions: Why is “Java is Slow” so Popular?結論:理由は、 " Javaは遅い"そんなに人気ですか?

Java is now nearly equal to (or faster than) C++ on low-level and numeric benchmarks. Javaは今ではほぼ等しい(またはよりも速く) C + +では低レベルとベンチマークの数値です。 This should not be surprising: Java is a compiled language (albeit JIT compiled).この驚くべきことはできません: Javaは、コンパイル言語(たとえのJITコンパイル)です。

Nevertheless, the idea that “java is slow” is widely believed.にもかかわらず、という考えを" Javaが遅い"が広く信じられています。 Why this is so is perhaps the most interesting aspect of this article.なぜこれは非常には、おそらく最も興味深い側面は、次の資料です。

Let’s look at several possible reasons:いくつか考えられる理由を見てみましょう:

* Java circa 1995 was slow. * Javaのcirca 1995年には遅いです。 The first incarnations of java did not java a JIT compiler, and hence were bytecode interpreted (like Python for example).の最初の化身のJava JITコンパイラJavaをしなかったし、それゆえにバイトコード解釈(たとえばPythonのように) 。 JIT compilers appeared in JVMs from Microsoft, Symantec, and in Sun’s java1.2.マイクロソフトからのJVMのJITコンパイラが掲載され、シマンテック社、およびSunのjava1.2です。

This explanation is implausible.この説明は信じ難い。 Most “computer folk” are able to rattle off the exact speed in GHz of the latest processors, and they track this information as it changes each month (and have done so for years).ほとんどの"コンピュータの民俗"ができるようにガラガラの正確な速度をGHzのオフの最新のプロセッサ、およびそれらの変更を追跡するこの情報は、毎月(とはこれは年間)です。 Yet this explanation asks us to believe that they are not able to remember that a single and rather important language speed change occurred in 1996.問い合わせはまだありませんこのような説明を要求されていないことを信じるだけのことを忘れないことができるよう、 1つの重要な言語というが発生した1996年にスピードを変更します。

* Java can be slow still. * Javaの静止が遅くなる可能です。 For example, programs written with the thread-safe Vector class are necessarily slower (on a single processor at least) than those written with the equivalent thread-unsafe ArrayList class.たとえば、スレッドセーフで書かれたプログラムをベクトルクラスは、必ずしも遅くなる(少なくとも、単一プロセッサ上で)に比べて書かれていますArrayListクラスに相当するスレッドに危険です。

This explanation is equally unsatisfying, because C++ and other languages have similar “abstraction penalties”.この説明は同様に満足感の得られないため、 C + +および他の言語と同様の"抽象化の罰則"です。 For example, The Kernighan and Pike book The Practice of Programming has a table with the following entries, describing the performance of several implementations of a text processing program:たとえば、カーニハンとパイクのプログラミングを予約して練習には、テーブルには、次のエントリを、いくつかの実装のパフォーマンスを記述するテキスト処理プログラム:
Version 400 MHz PII 400 MHz以上のバージョンpii
C 0.30 sec c 0.30秒
C++/STL/deque 11.2 sec C + +で/のSTL / deque 11.2秒
C++/STL/list 1.5 sec C + +で/のSTL /リスト1.5秒

Another evidently well known problem in C++ is the overhead of returning an object from a function (several unnecessary object create/copy/destruct cycles are involved).もう一つの既知の問題が明らかによくC + +では、オーバーヘッドからのオブジェクトを返す関数(いくつかの不必要なオブジェクトを生成/コピー/自爆サイクルが関与) 。

* Java program startup is slow. * Javaプログラムの起動に時間がかかる。 As a java program starts, it unzips the java libraries and compiles parts of itself, so an interactive program can be sluggish for the first couple seconds of use.としては、 Javaプログラムを起動すると、コンパイルunzipsのJavaライブラリや部品はそれ自身のため、インタラクティブなプログラムは、最初のカップル秒の低迷を使用します。

This approaches being a reasonable explanation for the speed myth.このアプローチが合理的な説明をする神話の速度です。 But while it might explain user’s impressions, it does not explain why many programmers (who can easily understand the idea of an interpreted program being compiled) share the belief.しかし、中に説明するかもしれないのユーザーのインプレッション数、多くのプログラマー理由を説明することはありません( whoは簡単に理解してアイデアを解釈するプログラムがコンパイルする)の信念を共有しています。

Two of the most interesting observations regarding this issue are that:最も興味深いの2つの観測については、この問題を解決すること:

1. 1 。 there is a similar “garbage collection is slow” myth that persists despite decades of evidence to the contrary, andには、同様の"ごみ収集が遅い"神話が続くの証拠があるにもかかわらず、数十年に及ぶその反対に、と
2. 2 。 that in web flame wars, people are happy to discuss their speed impressions for many pages without ever referring to actual data.ウェブ火炎戦争して、人々が幸せに速度を話し合うことなく多くのページの表示回数を実際のデータを参照する。

Together these suggest that it is possible that no amount of data will alter peoples’ beliefs, and that in actuality these “speed beliefs” probably have little to do with java, garbage collection, or the otherwise stated subject. Our answer probably lies somewhere in sociology or psychology.一緒に、これらの提案をすることが可能に変えることは絶対にありませんの量のデータを人々の信念ており、その実際に、これらの"スピード信念"はほとんど関係がない、おそらくジャワ、ガベージコレクションのか、または、他の記載アジ研です。 私たちのどこかに答え、おそらくうそ社会学や心理学です。 Programmers, despite their professed appreciation of logical thought, are not immune to a kind of mythology, though these particular “myths” are arbitrary and relatively harmless. プログラマー、公言したにもかかわらず、感謝の論理的な思考ではない神話のような免疫して、これらの特定の"神話"は任意と比較的無害です。

Here is another benchmark on Java versus C++ここでは別のベンチマークでJava対C + +で

The Java is Faster than C++ Benchmarkよりも速く、 JavaはC + +のベンチマーク

http://www.kano.net/javabench/
This was also quoted in JDJ magazine article: http://java.sys-con.com/read/45250.htmこれはまた雑誌の記事に引用さjdj : http://java.sys-con.com/read/45250.htm

“I used G++ (GCC) 3.3.1 20030930 (with glibc 2.3.2-98) for the C++, with the -O2 flag (for both i386 and i686). "私使われはg + + ( GCC )の3.3.1 20030930 ( glibcを2.3.2-98 )のC + + 、 - O2をフラグ( i386およびi686との両方) 。 I compiled the Java code normally with the Sun Java 1.4.2_01 compiler, and ran it with the Sun 1.4.2_01 JVM.私のJavaコードをコンパイルすると、通常のSun Java 1.4.2_01コンパイラ、太陽と同調して走ったこと1.4.2_01 JVMのです。 I ran the tests on Red Hat Linux 9 / Fedora Test1 with the 2.4.20-20.9 kernel on a T30 laptop.私は、そのテストをRed Hat Linuxを9 /ソフト帽test1の2.4.20-20.9カーネルは、ノートパソコンT30カタログです。 The laptop has a Pentium 4 mobile chip, 512MB of memory, a sort of slow disk.ペンティアム4のノートパソコンには、携帯電話チップは、 512 MBのメモリは、並べ替えの遅いディスクにコピーします。

The results I got were that Java is significantly faster than optimized C++ in many cases.私はその結果がより大幅に高速化最適化JavaはC + +では多くの場合です。 "
JVM startup time was included in these results. " JVMの起動時には、これらの結果に含まれています。 That means even with JVM startup time, Java is still faster than C++ in many of these tests. つまり、 JVMの起動時にも、ジャワよりも速くはまだ C + +での多くは、これらのテストを実行します。 "

BTW: The article also links to lots of other benchmarks at the end.ところで:この資料にもたくさんのリンクを他のベンチマークの最後にします。

Hopefully I have finally laid rest to the myth of “ java is slow “.うまくいけば私は最後に残りをlaidの神話" Javaは遅い "です。 It is a perception, a blatantly false perception, not a reality.それは、知覚は、露骨に虚偽の認識ではなく、現実です。 Get over it.取得される可能性があります。