http://www.ukhec.ac.uk/events/javahec/pozo.pdf Author: American National Standards Institute of Technology 12 tests, java winning seven. Java: c = 7: 5 ============== Conclusion: Most cases, Java is faster
http://www.idiom.com/~zilla/Computer/javaCbenchmark.html Author: American Computer Graphics and Immersive Technology Laboratory, University of Southern California JPLewis and Ulrich Neumann: Java leading ========= conclusion: Most tests win in Java
Http://www.shudo.net/jit/perf/fft, sor, monte carlo, sparse matmult, lu 5 Benchmark results: %%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%% Java / Sun JDK 1.4.2 Server VM = VS C / VC = 2: 3VC Winning Comprehensive Score 324 : 329 = 98.5% Java performance is C 98.5 here, C compiles with SSE2. Since the client VC (Windows) cannot be compiled with SSE2, all Java platforms can be run as long as the -server option can be operated. =========================== Conclusion: In most client programs, C programs run Java
Java speed is 122% of GCC
Java / Sun JDK 1.4.2 Server VM VS C / GCC (-O2) = 3: 2JAVA Winning Comprehensive Score = 324: 266 = 122% Java Performance is 122% of C / GCC So on Linux, Java is faster == ================= Conclusion: In most cases on non-Windows, Java is faster
http://www.javaworld.com/javaworld/jw-02-1998/jw-02-jperf_p.html in: java and C tied Integer divisionDead codeDead code with Integer divisionFloating-point divisionStatic methodMember methodVirtual member method in the following areas
But Java's speed is C about 3 times Virtual MeMBer method with down cast and run-time type Identification (RTTI) ===================== Conclusion : Comprehensive, Java faster http://www.kano.net/javabench/data=============== Conclusion: 14 Benchmark, Java wins 9, C 5 items Java overcome C at 9:5, and many of them are leading leading: Methord Call: nearly 20 times Object Creation: 4 times Hash: 2 times half Word Count: 1 half fibonacci: 1 times
: Http://www.tommti-systems.de/go.html? Http://www.Tommti-systems.de/main-dateien/reviews/languages/benchmarks.html
The following due to the third table opened the optimization option, so only the third project represents the true speed of Java, Java: C = 9: 5 big scores
The first two tables use the Java 1.5 Alpha beta, and the first two tables are not open-Server parameters. So we only look at the results in the third table (open -server optimized parameters):
The first name for various languages in various aspects:
Java 1.4.2_03 (9 items first): Double Mathtrig MathioExceptionhashmaphashmapsListnested Loopstring Concat
C (MS or Intel, 5 first. MS Compiler Options: / OP / OY / O2 / O / OG / OT / EHSC / Arch: SSE # Intel (R) Compiler Options: / OP / OY / QPC80 / FAST / G6 / O / OG / OT / EHSC / Arch: SSE) INT32 Mathlong 64 MatharrayHeapsortmatrix Multiply
It is worth mentioning that in the above test, Java's processing speed on Exception is about 18 times of C ===================== Conclusion: Java is open - After the server option, the champion of most tests has been obtained.
Http://cpp.student.utwente.nl/benchmark/: 14 Benchmark Java-Server Sun JDK1.4.2 with 6 to 8, over Inter C 8.0java-Server Sun JDK1.4.2 over 8-1 GCC-I686JAVA-Server Sun JDK1.4.2 overcome GCC-I686 at 7 to 7 ================= Conclusion: Basic War, in this test, the author said he "deliberate "Limits the amount of JVM memory usage, saying that this is to fairness with C . This is actually very unfair. Java open -server's purpose is to "use space change time", compile Bytecode into a larger but faster local code in memory, but the same is limited to the plane and car as the plane is like a plane. Like the number of gasoline, or the aircraft is limited to 5 meters or less (the aircraft is impossible to fly with the fastest speed in the case of lack of fuel or low altitude) seems fair, the faster is extremely unfair, the plane is A large amount of fuel to accelerate, what is better than the fuel? If you do not limit memory usage, I believe that Java will come back to an evidence faster:
IBM's Research JVM (Reference [38]) HAS Demonstrated That Java Canister Even for numerical calculations.
The IBM research JVM has proven that Java has exceeds C and Fortran in the performance of mathematical operations.
(Reference [38]: OF: S M. José Moreira, Manish Gupta, Thesis:. "A Comparison of Three Approaches toLanguage, Compiler, and Library Support for Multidimensional Arrays inJava,"
Presented at Joint ACM Java Grande - Iscope 2001 Conference, Stanford University, 2001.
2001 Iscope Conference, held in Stanford University in 2001) http://aspen.ucs.indiana.edu/gce/c536javacog/c536featuresofcog.pdf
We see that Java RMI performance is superior to HPC , Nexus RMI / HPC and Nexus RMI. . . . . More amazing is: After using JIT, Java RMI performance is better than HPC
We see that Java RMI outperforms HPC , Nexus RMI / HPC , and Nexus RMIfor suciently large data arrays. Since data is pipelined in Java RMI, but not in Nexus RMI, this resultis reasonable. What is more surprising is that when the JIT is enabled Java RMI is Able to OutperFormHPC .
Author: Fabian Breg, Shridhar Diwan, Juan Villacis, Jayashree Balasubramanian, Esra Akman, Department of Computer Science Department Dennis GannonIndiana University of Computer ScienceIndiana Universityhttp: //www.cs.ucsb.edu/conferences/java98/papers/rmi.pdf
Another evidence:
Title: Development of a java-based Meteorological Workstation by Germanmeteorology Service and Partners Germany Meteorological Services with Partners Developing Meteorological Workstation
German weather service dwd and germanmilitary geophysical service decided Two Years agoto develop a New Meteorological Workstation FromScratch German Meteorological Services (DWD) and German Military Earth Physical Service Decided to develop a new weather workstation .....
The performance issue was evaluated before in a pilot project and isanalysed during all phases of development. Itturned out that this is not a problem, however manythings must be considered in the design and duringcoding. Even numerical calculatuions are now inpure Java since we found they can Outperform C When CareFully Optimized. Performance issues have been evaluated before a navigation project development. The result is: Performance is not a problem, but a lot of things should be considered during the encoding process. We found that after optimization, pure Java even mathematical calculations also exceed C http: //ams.confex.com/ams/pdfpapers/52402.pdf
Any evidence: topic: << Is Java Ready for Computational Science? >> << Java is prepared for scientific calculations? >>
Source: Computer Science Dept., University of Karlsruhe, Germany Germany Karlsruhe University Computer Sciences Http://www.ubka.uni-karlsruhe.de/vvv/1998/informatik/27/27.pdf.gz
IBM's Java compilers over 3: 2 Fortran 90Fortran90: Java's results (in seconds) 20: 1440: 30440: 4441080: 108911790: 11690 lost two items not! There are two in the three gaps to lose, and there are two items winning more than 33%.
Conclusion in the article:
Conclusion: Java Will Become A Major Language for Computational Science.java will become the main language in scientific calculations
There is also an evidence: << Real Java For Real Time >> Using the real Javathe Best Jit Compilers TodayGenerate Code That COME COME CLOSEGENERATE CODE THAT COME COME CLOSE TO, OR IN SOSESES EVENOUTPERFORM, C code. Today's best JIT compiler can Creating performance proximity or even more than C
http://www.lucas.lth.se/publications/pub2002/nilsson_realjavaForRealTime.pdf
The three authors: Anders Nilsson, Torbjorn Ekman, Klas Nilsson
Department of Computer Science, Lund University, Sweden DEPT. OF Computer Sciencelund UniversitySweden
One More Evidence: << Java Server Benchmarks >> Among them, the performance of the CGI written by servlet and C / C .
Conclusion: Conclusion: Java Servlets Outperform CGI Java Servlet performance exceeds CGI http://www.research.ibm.com/journal/SJ/391/Baylor.html
Servlet and CGI performance comparison: Conclusion: servlet performance is much more than CGI written with C:
The result of the reference is: Manage - 64 node SP configuration development and successfully implementing Java and WebSphere installation and valid management processes. Stability - The stability of large-scale WebSphere configuration is proved by the oven test. In this test, 64 nodes of WebSphere system operate, hardware or software has no fault or errors. The resulting performance data for more than 12 consecutive years indicates stable throughput and CPU utilization. Scalability - In the configuration of up to 64 nodes, in the case of low and high workloads, the scalability is demonstrated by displaying almost linear throughput (number of page browsing / second / nodes). Performance - Java and WebSphere technology can complete the specified goals 300%. Current C / CGI technology, when the CPU utilization is 37%, approximately 1.3 page browsing / second / nodes; when the CPU utilization is 30-40%, IBM's Java and WebSphere technology offer approximately 3.8 page browsing / Second / node. When the CPU utilization is higher (> 90%), the configuration using 64 nodes can provide 564 page browsing / second / nodes in the case where the average response time is less than 2 seconds. Suppose is similar to the configuration installed in February 2000, this level of sex will be able to support 100,000 concurrent end user sessions in the Market Storm (there are a large number of requests during this period).
The chart saw the original origin: http://www-900.ibm.com/developerWorks/cn/wsdd/hvws/schwab2001.shtml
Evaluation report: .NET performance is still far behind Java
The running speed of the same code on .NET does not increase with the increase of the number of operations, indicating that Net CLR simply compiled JIT compilation. On the Hotspot Server, not only the performance of the performance is advantageous, but the speed will continue to improve.
It can be seen that as the number of runs increases, Sun Hotspot Server will continue to be large, and finally more than .NET 1.1 is twice. The .NET CLR will not be able to reduce the runtime to 8 seconds, while Sun HotSpot Server can be kept below 5 seconds after multiple run. Therefore, CAMERON believes that for the application of the Universiade, HOTSPOT JVM is much faster than Microsoft CLR. Http://www.5d.cn/bbs/archivecontent.asp?id=792254 Conclusion: Java is as fast as Fortran Java Pro 2002-2003 Chinese Essence Collection [Item 1] "Java is fast enough" http: // ACT .it.sohu.com / book / chapter.php? id = 51 & volume = 1 & chapter = 9 http: //act.it.sohu.com/book/serialize.php?id = 51 Reference JE MOREIRA, ET. Al., "THE NINJA Project," Communications of the ACM, 44 (10), 102, (2001). << ACM Communication >> Z. Budimli, K. Kennedy, And J. Piper, "The Cost of Being Object-Oriented: A Preliminary Study, "Scientific Calculation >> Scientific Computing, 7 (2), 87, 1999.
Zoran Budimli website: www.cs.rice.edu/~zoran
This is Sun comparison J2EE and .NETMark report: J2EE is 200% of .NET speed 200% Web Services PerformanceHttp: //java.sun.com/performance/reference/WhitePApers/ws_test-1_0.pdf
Possible third party conclusions will be more objective:
The latest data on November 4th, 2004! ! ! ! ! ! The results http://www.shudo.net/jit/perf/&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&FFT, SOR, Monte Carlo, Sparse matmult, LU five of Benchmark: &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& C # .net is not worth mentioning, 0: 5 defeat java. On a comprehensive score, Java VS C # = 324: 240java big score leading until Mono is worse than Java with 324: 163, the performance of the Monoswing GUI graphics interface: on menu, tree, text box, table, etc. , JDK1.4.0 is 40% to 90% faster than JDK1.3.1
Reflection's performance, JDK1.4.0 is 20 times faster than JDK1.3.1! More than 20 times more than the remote window call
On other items, JDK1.4.0 is almost 50% faster than JDK1.3.1, "Java slow" is just "history", other performance enhancements http://java.sun.com/j2se/1.4 /Performance.guide.html
Sun's data description, JDK1.4.2 performance is 50% to 380% of JDK1.4.1 can be seen, and almost every Java version is improved. So if you see a Benchmark in somewhere, C is fast than Java, it is likely to use the old version of Java. But C seems to have no speed in recent years http://java.sun.com/j2se/1.4.2/1.4.2_whitepaper.html
The speed of C is determined by the optimization of the machine language compiled when the programmer is developed. Java's speed is determined by the Java Bytecode "instant" to the local CPU's optimized local code as the Java's JIT and HotSpot compilers.
The actual speed is actually ratio: see C compiler and Java compiler who can produce more optimized machine code. Obviously, the C compiler is not as good as Java's JIT and HotSpot compiler, because JIT and HotSpot compilers can optimize the CPU instruction set, can inline and optimize the Method based on the frequency of use. The C static compiler will never do these both, but some qpper can't understand this difference with a lifetime. They can only hold a poor, there is no basis "C than Java fast Entering coffin
Some QPPERs believe that there is no Java at all, there is only C , Java is just a C program. But they are intended to avoid a fact:
The local code compiled with the C compiler is the local code compiled with the C program with the FORTRAN compiler. It is the local code compiled with the Delphi compiler. It is the local code compiled with the C # compiler of the Delphi program. The local code compiled with the VB.NET compiler is the local code compiled with the VB.NET program with a Java compiler is a Java program.
If you look at some of the QPPER's view, there is only a language in the world, because other languages are in the end of the machine language program, is it not absurd?
Java's local code is compiled with Java's JIT and HotSpot compilers. It is not compiled by the program runtime, so the Java program is not a C program at all!
The JIT and HotSpot compiler can be optimized according to the CPU running CPU, can the C compiler? Is the JIT and a HotSpot compiler that perform INLINE and other inline, C compiler, based on the Profile of the program. The JIT and HotSpot compiler can perform more accurate branch prediction according to the program running according to the program run, can the C compiler?
Everyone can go to the JRE1.5.0 installation path to see: where the JAR file has a total of 50.5m, because the JAR file is compressed file, and the Bytecode code is more streamlined than Native Code (have already said: a constructor Methods In Bytecode, as long as one instruction is one instruction, the construction method is 11 instructions in the C compiler. Java A Method Call is as long as a Machine Code, but uses X86 to relatively 4), so this 50.5m Java program is completed. Approximately 200M or more local code completed. Among them. EXE and .DLL have a total of 7.7m, and the proportion of local code is less than 5% in the Java operating environment.
This only 5% "C compiler generated by local code" (such as AWT.DLL) is still re-compiled by the JIT and HotSpot compiler when running in the Java program (for example: in line with SSE2 instructions) The set of instructions is a new NativeCode sequence in Native Code, which is in the Native Code compiled by running to other Java compilers.
So the C compiler compiles the machine code sequence of the Java local library. When Java is running, these machine code is also re-compiled and changed by Java's JIT and HOTSPOT compiler, these "C compiler compiles Machine code "has become" Java Compiler Compile Machine Code ". In the end, all machine language sequences executed in the CPU are generated by the Java compiler, and there is no relationship with the C compiler. The following is the theoretical basis for Java than C :
About Java is so fast: Some things have only JIT can do:
For example, mention: http://www.idiom.com/~zilla/computer/javacbenchmark.html
The Compiler Knows What Processor It is Running On, And Can Generate Code Specifically For That Processor. The JIT compiler knows what the processor is running, can generate an optimized code corresponding to this processor. At this point, C static compiler will definitely do it.
# The compiler knows what processor it is running on, and can generate code specifically for that processor. It knows whether (for example) the processor is a PIII or P4, if SSE2 is present, and how big the caches are. A pre- Compiler on The Other Hand Has To target The Least-Common-Denominator Processor, at Least In The Case of Commercial Software.jit Compiler knows what the processor is running, can generate an optimized code corresponding to this processor. It knows whether the processor is P3 or P4, whether SSE2 exists, how much cache is. A pre-compiler such as a C can only compile the "minimum blending mother" of all processors, at least in commercial software.
# Because the compiler knows which classes are actually loaded and being called, it knows which methods can be de-virtualized and inlined. (Remarkably, modern java compilers also know how to "uncompile" inlined calls in the case where an overriding method is loaded After the Jit Compilation Happens.) Because the JIT compiler knows which classes are actually loaded and called, it knows what methods can be "de-virtualized" and inline (worth mentioning: contemporary Java compiler It can also be found that in the case where the way is covered, the "inverse compile" inline method is called after JIT compile)
# A Dynamic Compiler May Also Get The Branch Prediction Hints Right More Often Than A Static Compiler. Dynamic compiler can make more branch predictions
Key highlights: *** Java speed is so fast (Source: IBM Tokyo Institute) http://www.is.titech.ac.jp/ppl2004/proceedings/ishizaki_slides.pdf*** 6 Step optimization, there are several small steps in each overall, a total of ten steps.
Look at yourself, English is relatively simple, but it is more difficult to understand, if you don't understand, others understand the same.
"It's hard to believe that Java can actually be as fast as C , and even faster."
According to my own practice, this statement is indeed established. However, I also found that many suspects from speeds come from some early implementations. Since these methods are not particularly effective, there is no model for reference and cannot explain the reason for Java speed.
I think the speed is due to the C model. C puts its own main energy in all things happening during compilation, so the running period of the program is very short and fast. C is also based on the C model based (mainly for backward compatibility), but sometimes only works in a specific manner because it can be used in C, which is also the most convenient method in C . One of the most important situations is C and C to manage the memory. It is some people who feel that Java speed is sure slowly: in Java, all objects must be created in memory "Heap".
In C , the object is created in the stack. This can reach a faster speed, because when we enter a specific scope, the stack pointer moves down a unit, allocating storage space for all objects based on the scope, and all objects based on the stack. When we leave the action domain (after the call is completed, the stack pointer moves up one unit. However, creating a "memory" (HEAP) object in C is usually much slower because it is based on the memory stack of C. Such memory stacks are actually a large memory pool that requires recirculation (regeneration). After calling Delete in C , the released memory will leave a hole in the heap, so when the New is called, the storage allocation mechanism must perform some form of search, so that the storage of objects is associated with any ready-made cave in the stack. Otherwise, you will quickly use the storage space of the light. The reason why the memory reactor will have such a major performance impact in C , and the search for available memory is an important reason. So create more stack-based objects.
Similarly, because C so many work is done during compilation, this must be considered. But in some places in Java, things happen to be "dynamic", which will change the model. When creating an object, the use of the garbage collector has a significant impact on the speed of increasing the creation of the object. From the surface, this statement seems to be a strange-storage space release will affect the distribution of storage space, but it is one of the important means of JVM, which means that the storage space is allocated to the heap object in Java. Almost achieve the same speed as c creates a storage space in the stack.
You can imagine C piles (and slower Java piles) to an a court, each with your own land. At some time, this "real estate" will be abandoned and must be regenerated. But in some JVM, the Java pile works is quite different. It is more like a conveyor: After each assignment of a new object, it will move forward. This means that the assignment of object storage space can reach very fast speed. The "heap pointer" simply moves forward to the virgin, so it is almost identical to the C stack allocation (of course, there will be more expenses more expensive on the data record, but it is more than the search storage space). Now, everyone may notice that the stack is not a belt. If you treat it in that way, you will eventually ask for a lot of page swap (this will produce great interference on performance), which will eventually use optical memory, and memory paging errors. So this must take a skill, that is, the famous "garbage collector". It is also responsible for collecting "garbage" and is responsible for compressing all objects in the stack, moving "heap pointers" to the place where the transfer belt begins, and stays away from the place where (memory) pagination is wrong. The garbage collector will rearrange everything to make a high-speed, unlimited freestate stack, while the excluding storage is allocated.
To truly master its principle, we first need to understand the work program taken by different garbage collectors (GC). A simple, but slower GC technology is a reference count. This means that each object contains a reference counter. Whenever a handle is connected to the same object, the reference counter will value the value. Whenever a handle exceeds its own scope or set to NULL, the reference count is impaired. In this way, as long as the program is in operation, continuous reference count management - although this management itself has less overhead. The garbage collector will move in the entire object list. Once it finds that one of the reference counts become 0, the storage space it occupies is released. But there is also a disadvantage that if the object is recycled, even if the reference count is not 0, it is still possible to belong to "garbage" that should be received. In order to find out this self-cited group, the garbage collector is required to make a lot of extra work. The reference count belongs to a type of garbage collection, but it does not sufficiently adoption in all JVM schemes.
In a faster speed, garbage collection is not built on the reference count. Instead, they are based on such a principle: all non-dead locks will eventually go back to a handle, or the handle either in the stack, or exist in static storage. This backchain may have experienced several layers. So, if you start from the stack and static storage area, you can find all active objects. For each handle you found, you must track the object it point to, then follow all the handles in that object, "Track Pursue" to the objects they point to ..., until it traversed from stack or static storage area The entire link network initiated by the handle. Each object that is moved in the middle must still be active. Note that for those special self-cited groups, there will be no previous problems. Since they are found at all, they will be automatically treated as garbage.
In the method described here, JVM uses an "adaptive" garbage collection scheme. For those active objects it find, the specific operation depends on what variants currently being used. One of the variants is "stop and replication". This means that because some will be very obvious, the program will stop running (not a background collection scheme). Subsequently, each active object found will be copied from one memory pile to another, leave all garbage. In addition, as the object is copied to a new heap, they will be focused together. This makes the new stack more compact (and make the new storage area can simply extract the end, as as previously described). Of course, when an object moves from one place to another, all handles (references) that point to that object must be changed. For those handles obtained by tracking the objects of the memory, and those static storage areas can be changed immediately. But in the "traversal" process, it is also possible to meet other handles to this object. Once this problem is found, the amendment is now revised (imagined a hash table to map the old address into a new address).
There are two questions that make the replication collector have a low efficiency. The first question is that we have two stacks, all memory is moved back and forth in these two independent stacks, and the amount of management requiring is twice as required. To solve this problem, some JVM allocate memory piles as needed and simply copied a heap to another.
The second question is copy. As the program becomes more and more "robust", it has little or rare garbage. Despite this, a copy collector will still copy all memory from one place, which is very wasteful. In order to avoid this problem, some JVM can detect whether there is no new garbage, and then change another solution (this is the "adaptive" reason). Another solution is called "Mark and Clearance", and Sun's JVM has always used this solution. For conventional applications, markers and clearance are very slow, but once they don't generate garbage, or only rare rubbish, it will be very fast.
Tags and clears use the same logic: starting from the stack and static storage area and tracking all handles, looking for an active object. However, each time I find an active object, a tag is set, and the "marker" is made for that object. But this object is not collected. The clear process is officially started only when the marking process ends. During the clear process, the deadlock object will be released However, no form of copying is made, so if the collector determines to compress an intermittent memory stack, it is implemented by moving around the object.
"Stop and Replication" to us indicate that this type of garbage collection is not conducted in the background; the program will stop running once garbage collection occurs. In Sun's document library, you can find that many places define garbage collection into a low-priority background process, but it is just a theoretical experiment, and it is actually not working. In practical applications, Sun's garbage collector will run when the memory is reduced. In addition, "Markers and Clear" also require the program to stop running.
As early as possible, in the JVM described here, memory is allocated by mass. If you assign a large piece of head, it will get your own memory block. Strict "Stop and Replication" requires a new heap of each activity from the source pile to a new heap before the old heap is released, and it will involve a large number of memory conversion work. By memory blocks, garbage collectors can usually use the dead block replication object, just like it is collected. Each block has a generated count for tracking it still "survive". Typically, only the blocks created since the last garbage collection will be compressed; for all other blocks, if references from other parts, then the generated count overflows. This is a lot of short-term, temporary objects often encountered. A complete clear work will be performed periodically - the object of the large block is still not replicated (just let their generation count overflow), and those blocks that contain small objects are copied and compressed. JVM monitors the efficiency of the garbage collector. If all objects belong to long-term objects, the garbage collection is a process of wasting time, it will switch to the "Mark and Clear" scheme. Similarly, JVM will track the successful "tag and clear" work of success. If the memory stack becomes more and more "scattered", it will be replaced back to the "Stop and Replication" scheme. The "custom" said that from this behavior, we finally summarize it: "According to the situation, automatic conversion and copy / mark and clear these two modes." JVM also uses many other acceleration schemes. One of these is particularly important involves loaders and JIT compilers. If you have to load a class (usually when we want to create one object of that class), you will find the .class file, and send the bytecode of that class into memory. At this point, a method is to compile all code with JIT, but there are two disadvantages: it will spend more time, if comprehensively considering the running time of the program, compile time may be longer; and it increases The length of the execution file (the byte code is much sminter than the JIT code extension), which may cause memory page exchange to significantly slow down a program's execution speed. Another alternative is: unless it is necessary, it will not be compiled by JIT unless it is necessary. In this way, the code that does not execute will never get JIT compilation.
Since JVM is external to the browser, you may wish to get benefits from some JVM speeds when using your browser. But very unfortunate, JVM is currently not communicating with different browsers. In order to play a specific JVM potential, either use the JVM browser, or only the stand-alone Java application is run. http://pub.chinans-ls.com/~jx/java/chapter/appe.htm
The following article also illustrates the advantage of the Java compiler than the C static compiler:
On the JAVA VM Development (Author: Huang Jing group) excerpt:
C Virtaul Method Calling: No argument 4 instructions
C General Call: Not Argument 2 instructions
Java's Virtual Call: Not Argument 2 instructions.
C constructor: 11 instructions
C DEStructor: 8 instructions
Java's Constructor: 2 instructions
This can be found that the operation of the dynamically configurable object, Java is a Method Call as long as a Machine Code, but is relatively related to X86, which is that Java is directly supported in the instruction set level.
JOAKIM DAHLSTEDT is not small, is the main designer of JROCKIT VM. The current technology is long. This article is not the old king selling melons. On the contrary, Joakim wants us to clear, and java VM "Benchmark". The way to evaluate it needs to be adjusted, mainly based on the following: 1. General Benchmark is just Micro-Benchmark Level, cannot be extended to System-Level. 2. Software industry development has undergone great changes, a large number of Class Library, Framework, Application Server, and even Web Services. Competing old Benchmark can only be a comprehensive analysis of SYSTEM-Level, so that there is a problem with SYSTEM-Level. 3. The Dynamic Optimization of the Java VM itself, can be reorganized for efficacy according to the most authentic PROFILING data adjustment components. 4. Finally, the new CPU architecture, like Intel EPIC, may be more suitable for Dynamic Optimization, not traditional Static Compiler. Under EPIC's architecture, Compiler's impact is quite large, and Compiler has a responsible set of instructions in parallel, not like traditional Pentium to introduce automatic Out-of-Order's downtime, which means that the software gives EPIC The performance, this is unfavorable to Static Compiler because only fixed statistics and symbols from Bytecode, but it is not possible to plan real profile.
JOAKIM's conclusion gives us very good inspiration:
"In conclusion, ..., but I hope I've convinced you that using runtimesystems like Sun Microsystems' HotSpot or BEA WebLogic JRockit Javais not slow or inefficient, and that the performance of a large-scalesystem built with Java may be superior to That of the same systembuilt using c. "
IBM's JDK once an idea of the best performance Java VM, but Sun JDK 1. 4 has been comparable to IBM JDK1.3, and its Server version uses more active JIT and GARBAGE COLLECTION technology, especially for SMP. The application provides a GC that best suits the hardware architecture and multi-execution.
On the other hand, IBM provides an internal JALAPENO JVM research [6] with the JIKESRVM schedule released by Open Source [7], providing a reference to a reference-to-reference implementation platform for techniques such as JIT and GC and other technologies and algorithms. . IBM Rearch treats Jikesrvm as a Research Infrastru-CTure in JIT, and listed a considerable paper on the website. The author refers to the direction of JIKESRVM, and the JIT Compiler's trend can be listed below: 1. Similar to Hotspot [8] integrate Base Interpreter, PROFILING, and AdaptiveCompiler pathway. 2. Dynamic Profiling technology evolved from simple Counter-based Algorithm to Performance Monitoring Event. 3. Apply compilation technology in static Compiler (for Jit Compiler, compile time is secondary problem), generate optimization code. 4. Apply inter-procedural analysis, such as Escape Analysis, can remove synchro-nization and implement Stack Allocation. 5. Refer to the information obtained by Runtime (mainly Metadata and Dynamic Allocation), resulting in optimization native code. [6] http://www.research.ibm.com/jalapeno/[7] http://www-124.ibm.com/developerWorks/oss/jikesrvm/[8] http://java.sun.com / products / hotspot /
Then let's take a look at the sun's HotSpot technology. Referring to HENRY MASSALIN This pioneer, Henry's doctoral thesis is known as "The Mother of All self-modifying code" in Java Glossary's HotSpot [9], and HotSpot is also "Builds Heavilyon Work Done" IN a phdhet by henry massalin.
[9] http://mindprod.com/jgloss/Hotspot.html
Java initial work is through the transpreter, but this is not to be described in Java. Early Java VM is indeed an interpretation of the command one by one, so it is extremely unsatisfactory, so it introduces key technologies such as JIT, and Hotspot can tell the next generation JIT. According to Sun's official literature, Java VM using HotSpot is difficult to distinguish when Java Bytecode is executed by JVM, because Hotspot actually compiles Java's Bytecode to the original code execution.
In fact, two technologies are quite important in HotSpot, which is called DynamicCompiLation and Profiling. HotSpot is compiled by Bytecode, which is not pre-compiled pre-program execution (which is relative to Static Compiration). Conversely, in the program execution, the compiler built by the hotspot is dynamically compiled. Early JIT (Just In Time) is actually the same concept, but there is no Hotspot to be comprehensive. So, how is HotSpot dynamically compile Java Bytecode? HotSpot uses a highly elastic design that maintains Profile Monitor, specifically monitored program execution, and the frequency used in the judgment segment is high, and the extent to the performance impact is delivered to several ranking algorithm processing. HotSpot has a larger code code segment that affects the programs perform efficiency, which is recommended as Hot Spot (especially lowercase writing, avoid confusion with HotSpot), and HotSpot will dynamically compile the original code, at the same time, will be based on Profiling As a result, these native codes are optimized, thereby increasing execution efficiency. Conversely, if the low frequency program segment is performed, the hotspot does not have to spend time doing dynamic compilation, just need to be executed in the direct translator.
Overall, under Hotspot, Java Bytecode is loaded into JavaVM in interpreting. However, in accordance with the state performed by some program code segments, it is known to have the greatest impact on the performance of the performance, through dynamic compilation and Optimization processing, establishing a original code, so, a considerable degree of performance increase can be obtained during the next execution. We can learn that HotSpot has the following three ways of execution of Bytecode: And what is the best treatment, the entire process is determined by the Profile Monitor. What is the advantage of using Dynamic Compilation than the traditional Static Compilation? Open cross-platform demand, whether Dynamic Compilation is superior to traditional ways, especially the ability of Profiling. In the past, Static Compilation is difficult to accurately, what is the most needed to optimize the processing, which can only be constructed by built-in Template to construct the best chemical code code of Micro-Level. On the contrary, Dynamic Compilation can learn the most authentic PROFILING performance, which is more important in the future processor, which is more important, because the past hardware work is gradually transferred to the software. The responsibility of Compiler Optimization is extravagant, like the Average of Intel EPIC architecture.
Another typical example called Method Inline. Whether in C or Java, the call (Invoke) Method is consuming system resources, and the system must maintain stacking to meet the expected Calling Convertion. So, some people put forward the processing of the original INVOCATION, modho, "embedded" to the original call, so it is just simple step-by-step execution, and there will be no stacking operation. However, Method Inline means that the compiler is difficult to have a good work manual, because it is necessary to take care of the characteristics of the object orientation, especially the nature of Dynamic Binding. Static Compiler can actually make Method InLinng, which is Private and Static's Method, but once there is Overridden or Dynamic Binding, Static Compiler cannot know that the actual execution status will be conservatively not implemented. This problem, it can be solved by the design of Hotspot, a class of Dynamic Compilation, because PROFILING MONITOR can master the situation of Method Invocation. Of course, it can be accurately known in Runtime, RTTI (Run-Time Type Identification) can assist hotspot processing Method Inline, so When the Server-Side application is executed, there is a lot of effective performance. Sun's literature also pointed out that in some cases, Java's application can even be faster than traditional C programs.
In terms of current development, JIT Compiler's cost is mainly in PROFILING and Dynamic Compila-TION. Ideally, these two costs should be considered Constantant Time, so many research papers have been proposed as performance improvements. It is specially used for Jit Compiler, and the accuracy does not require a high Javaruntime Profiling Profiler for JavaVirtual Machine, and the paper proposes to use Sampling to do approximation. As for the Dynamic Compilation, Overhead can be reduced by progressive optimization, and there is a detailed introduction of the HotSpot white paper in Sun.
Full text http://dev.9cbs.net/develop/Article/54/54057.shtm