Article on Performance of Java versus C++

http://java.about.com/gi/dynamic/offsite.htm?site=http://www.idiom.com/%257Ezilla/Computer/javaCbenchmark.html

Seems like a relatively unbiased evaluation.

Similar Messages

  • How to get comparable Oracle JDBC performance using Java 1.4 vs 1.1.7?

    Our application makes extensive use of JDBC to access an Oracle database. We wrote it a number of years ago using java 1.1.7 and we have been unable to move to new versions of java because of the performance degradation.
    I traced the problem to JDBC calls. I can reproduce the problem using a simple program that simply connects to the database, executes a simple query and then reads the data. The same program running under java 1.4 is about 60% slower than under java 1.1.7. The query is about 80% slower and getting the data is about 150% slower!
    The program is attached below. Note, I run the steps twice as the first time the times are much larger which I attribute to java doing some initializations. So the second set of values I think are more representative of the actual performance in our application where there are numerous accesses to the database. Specifically, I focus on step 4 which is the execute query command and step 5 which is the data retrieval step. The table being read has 4 columns with 170 tuples in it.
    Here are the timings I get when I run this on a Sparc Ultra 5 running
    SunOs 5.8 using an Oracle database running 8.1.7:
                     java 1.1.7  java 1.4
            overall:    2.1s         3.5s
            step 1:     30           200
            step 2:    886          2009
            step 3:      2             2
            step 4:      9            17
            step 5:    122           187
            step 6:      1             1
            step 1:      0             0
            step 2:    203           161
            step 3:      0             1
            step 4:      8            15   <-   87% slower
            step 5:     48           117   <-  143% slower
            step 6:      1             2I find the same poor performance from java versions 1.2 and 1.3.
    I tried using DataDirect's type 4 JDBC driver which gives a little better performance but overall it is still much slower than using java 1.1.7.
    Why do the newer versions of java have such poor performance when using JDBC?
    What can be done so that we can have performance similar to java 1.1.7
    using java 1.4?
    ========================================================================
    import java.util.*;
    import java.io.*;
    import java.sql.*;
    public class test12 {
        public static void main(String args[]) {
            try {
                    long time1 = System.currentTimeMillis();
    /* step 1 */  DriverManager.registerDriver(
                        new oracle.jdbc.driver.OracleDriver());
                    long time2 = System.currentTimeMillis();
    /* step 2 */  Connection conn = DriverManager.getConnection (
                  "jdbc:oracle:thin:@dbserver1:1521:db1","user1","passwd1");
                    long time3 = System.currentTimeMillis();
    /* step 3 */  Statement stmt = conn.createStatement();
                    long time4 = System.currentTimeMillis();
    /* step 4 */  ResultSet rs = stmt.executeQuery("select * from table1");
                    long time5 = System.currentTimeMillis();
    /* step 5 */  while( rs.next() ) {
                      int message_num = rs.getInt(1);
                      String message = rs.getString(2);
                    long time6 = System.currentTimeMillis();
    /* step 6 */  rs.close(); stmt.close();
                    long time7 = System.currentTimeMillis();
                System.out.println("step 1: " + (time2 - time1) );
                System.out.println("step 2: " + (time3 - time2) );
                System.out.println("step 3: " + (time4 - time3) );
                System.out.println("step 4: " + (time5 - time4) );
                System.out.println("step 5: " + (time6 - time5) );
                System.out.println("step 6: " + (time7 - time6) );
                System.out.flush();
            } catch ( Exception e ) {
                System.out.println( "got exception: " + e.getMessage() );
            ... repeat the same 6 steps again...
    }

    If I run my sample program with the -server option, it
    takes a lot longer (6.8s vs 3.5s).Which has to be expected, as the -server option optimizes for long running programs - so it shoudl go with my second suggestion, more below...
    I am not certain what you mean by "just let the jvm
    running". Our users issue a command (in Unix) which
    invokes one of our java programs to access or update
    data in a database. I think what you are suggesting
    would require that I rewrite our application to have a
    java program always running on the users workstation
    and to also rewrite our
    commands (over a hundred) to some how pass data and
    receive data with this new server java program. That
    does not seem a very reasonable just to move to a new
    version of java. Or are you suggesting something
    else?No I was just suggestion what you descript. But if this is not an option, then maybe you should merge your java-programs to C or another native language. Or you could try the IBM-JDK with the -faststart (or similar) option. If thew Unix you mention is AIX, then there would be the option of a resetable-vm. But I cannot say if this VM would solve your problem. Java is definitly not good for applications which only issue some unqiue commands because the hotspot-compiler can not be efficiently used there. You can only try to get 1.1.7 performance by experimenting with vm-parameters (execute java -X).

  • Bad performance of Java Web Report in BI 7

    We are experiencing poor performance with Java web application(EP)
    comparing to that with ABAP web.
    We migrated our BI reports from the ABAP web interface to the Java web
    interface due to our upgrade to Netweaver2004 environment.
    The problem is that it takes much longer time to load the BI reports in
    Java web than in ABAP web.
    It is the same situation in RSRT. Java web needs more time to execute
    the same query.
    there is no EP logon performance delay, so I think the EP is configured good.
    But the response time of BI Java Web Report is delayed average of 4~5
    seconds in every Query compared in that of ABAP Web report.
    Anyone experience this situation?

    Hi,
    I am facing similar problem. How did you solve it?
    Regards,
    Apurva

  • What are the main things to do when optimizing the performance of Java App

    what are the main things to do when optimizing the performance of Java App

    what are the main things to do when optimizing the performance of Java App

  • Just read "Best of Macworld" article "How to disable Java on your Mac," in email dated 2/25/13. I run OS 10.4.11 and Java 1.5.0_19. Do I remove/isolate the same way? Will the effects of removal/isolation the same as described in the article?

    Just read "Best of Macworld" article "How to disable Java on your Mac," in email dated 2/25/13. I'm a dinosaur running OS 10.4.11 and Java 1.5.0_19, which is earlier than the versions addressed in the article. Do I remove/isolate in the same manner? Will the effects of removal/isolation the same as described in the article?

    Hello, if you're talking about disabling Java in say Safari...
    Safari>Preferences>Security>uncheck/Disable Java in your Browser settings, not JavaScript.

  • How to embed/perform a Java Swing form into webased Swing form

    How to embed/perform a Java Swing form into webased Swing form or any alternative.
    Suppose i have 2 or more swing forms which are desktop applications but i want those forms to be now webbased..so how can i do this.Will i need to change the swing coding or will have to keep the swing design same.what can be the best Solution.

    You can launch your existing desktop app via the web using [Java Web Start|http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp]

  • Performance of Java Swing Vs Ajax ( Java Script )

    We had developed application in swing which displays the data received after querying to web-service in Table and JTrees.
    The current technological move is toward Ajax, It is ok that I can build this application in Ajax but not willing to go for replacment to swing.
    I had following question, why should I go for Ajax over swing considering my type of application only ( beside plugins,JRE.. )?
    And Peformance of Java script ( AJAX ) application over swing on following gorund?
    1. Rendering of components in Swing & HTML ( browser )
    2. Peformance of Java Script over Java ( CPU, Memory usage )
    3. Event model in Java Script over java swing
    4. Multitasking & Multithreading.
    5. Storing data in variables.

    The advantage of AJAX over Swing is clear, no special software is needed on a client computer other than an up to date browser.
    Swing does have some advantages however in that it is much more established and there are many more tools available for developing a front end GUI application in Swing.
    I have yet to find what I consider a "good" IDE for Javascript development on multiple platforms, Eg. IE, Firefox, etc...
    Javascript is also not truly object oriented and that makes organizing your code and your design harder.
    Performance I feel is a moot point between the two as it would hardly be noticeable, however I would guess that Javascript might have less performance than Java.

  • Unbiased Java versus C# comparison

    I found this feature-by-feature, unbiased and informatve Java versus C# comparison, and thought that perhaps a few of you may be interested in it:
    http://www.prism.gatech.edu/~gte855q/CsharpVsJava.html
    Every comparison that I've read up to this point has either been written by Java or MS evangelists, and this one is definitely refreshing break from the typical essay.

    Agreed. However, the decision may generalize even further in many cases, and become "Industry supported platform of technologies (Java) or Microsoft proprietarization (.NET)." I still have not seen an unbiased comparison of the platforms, rather than languages, that goes as in depth as this one... if anybody else has, I'd love to see a link to it?
    For those that will be using both technologies, such as myself, this paper helps bridge the language gaps between the two and make transitioning simple. It's more helpful at the post-decision (to use .NET) level, rather than pre-decision.

  • Performance of Java API 2

    Hello,
    we are currently using Java API 2 that comes with MDM 5.5 SP5 (Build 5.5.42.65) to read extended information from the mdm repository.
    Our process:
    We are export every product as a XML file over the MDM Syndicator and enrich this file with extended information from the API (This step is needed because we cannot export all data by the Syndicator, for example multilingual attributes / some product data like textblocks / id's for incremental updates ...).
    Actually the performance is really bad, we need ca. 10-15 secs to process one file, that is really frustrating when you have stored near 70.000 products in your repository.
    Are there some tricks to improve the performance or is the API really so slow? Or any better alternatives for an fast export?
    Thanks for your help ....
    Best Regards,
    Jan

    1 - If you are able to use the EJB connection with the LiveCycle SDK classes (you have are using a supported java version such as 1.5_xx, your network security doesn't prevent RMI calls, etc.) then that is your best bet.
    2 - Yes, you will need the java APIs to be accessible for your application. The LiveCycle APIs have remote EJB endpoints so you can access them from another server.
    3 - There are samples that ship with the LiveCycle server (located in your LCInstall\LiveCycle_ES_SDK\samples\Forms). There are also samples on the LiveDocs page at: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000064.html

  • Performance: Reports Builder versus Running on mid tier report server.

    Folks are wondering why a report takes 15 minutes when running on the middle tier report server, paper layout, pdf output displayed via adobe, versus running the paper layout from a laptop within Reports Builder.
    Any thoughts about the performance differences we now face with the 3 tier set up or suggestions on what we might tweak?

    hello,
    unfortunately your post did not specify what the difference in performance is and whether you are connecting to the same database and what platform your deployment environment as oppsed to your dev environment is.
    there are certainly some performance differences expected if the depoloyment platform is significantly different from the development paltform, but those differences should not be significant.
    there are certain things that might cause performance differences (e.g. graphs in reports, using DISPLAY vs. DEFAULT_DISPLAY on unix platforms, etc.) so knowing a bit more about your platform would be helpful.
    also it would be interesting to know if you see a similar degredation with other reports or even the test.rdf that comes with the product. last, but not least, have you tried to deploy your report to the OC4J that comes with the developer suite ? if so, do you see timings similar to the builder or more to your app server execution times ?
    thanks,
    philipp

  • How to improve performance of java.awt.choice

    Hi!
    In my GUI I'm using a java.awt.choice. The problem is, when my app starts this choice is filled with lots of values with add(...).
    This takes quite a long time. I've already set the choice invisible before the filling, so a little bit performance is gained there.
    Is there any other way to tune this choice?
    Thank you!

    Try to fill the choice before adding it to the container

  • How to improve the performance of java card OS?

    Hi All,
    we are into Java card OS developement. We need some tips for performance improvement of OS.
    1. what are the possible calculations we can do during loading so that we show good performance during operational mode.
    2. Tips in bytecode implimentation.
    Thanks

    Dear Friend,
    Performance term has relative character in Java Card implementation because there is no etalon. CREF is PC simulated software and can not be used for measurements. So for determining card performance only another implementation comparison can be suggested. Few things should be taken in account while card implementation comparison.
    1. Measurement is done by analysis of time consumption by the card to perfrom a command starting from data transfer and ending by status code.
    2. Same bytecode should be used in both samples.
    3. Same transmission rate should be used.
    4. Analysis of similarity of hardware including CPU, persistent memory programming time
    5. To perform that kind of measurement special tool listeting to terminal-smartcard interface is required
    I have no tips to bytecode implementation because bytecode is a thing that is determined by same Sun compiler and Java Card converter. So all are in the same conditions.
    Yours sincerely
    Dmitri

  • Process Performance monitoring Java API

    Hi,
    I am looking for java API's which can help me monitor performance stats like CPU utilization, memory utilization etc on a windows platform. I did get a handle on few APIs to measure memory utilization but somehow monitoring the CPU seems to be a problem. My requirement is to measure CPU and memory for a particular process and not for the entire system. Any pointers on this front would be of great help.
    Thanks
    Bhavin

    I don't see any great free libraries that you can just drop in and make this happen.
    There's an interesting looking product called "SIGAR" that seems to speak directly to what you want to do here.
    Or this might be a great opportunity for you to play with JNI and some C++... awesome! ;-)

  • Improving performance for java

    I'm new to this so please bare with me ... I have 2 basic questions
    I just upgraded my server to SunOS 5.10 Generic_139555-08 sun4u sparc SUNW,Sun-Fire-V440
    I also upgraded java to java version "1.6.0_14"
    This is a 4 processor box. Top gives me:
    last pid: 26233; load averages: 2.79, 2.99, 3.12 13:23:57
    174 processes: 172 sleeping, 2 on cpu
    CPU states: 40.2% idle, 54.2% user, 5.6% kernel, 0.0% iowait, 0.0% swap
    Memory: 8192M real, 3059M free, 6156M swap in use, 4105M swap free
    PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
    17294 prodslic 270 0 0 654M 641M cpu/1 527:36 50.02% java
    *!st Question:*
    *1. Why is java using so much cpu time?*
    When I run ps -ef | grep java:
    root 15666 1 0 Aug 10 ? 4:52 /usr/java/bin/java -server -Xmx128m -XX:+UseParallelGC -XX:ParallelGCThreads=4
    prodslic 17294 1 25 18:07:14 ? 530:07 /usr/jdk/instances/jdk1.6.0/bin/java -Xmx1024m -Djava.awt.headless=true -Djava.
    *2nd Question:*
    *2. Why are there 2 java version running?*
    /usr/java/bin/java -versionjava version "1.5.0_18"
    /usr/jdk/instances/jdk1.6.0/bin/java -versionjava version "1.6.0_14"
    This is confusiing to me. I'd also like to know what the different command line options mean
    Thanks
    Edited by: BH80477 on Aug 14, 2009 8:19 AM

    Claudia,
    We have not yet released a "production" version of OHJ 4.2 because 1) we'd like to add a few more features before calling it production, and 2) OHJ 4.2 has not yet shipped with an Oracle product and therefore hasn't undergone the rigorous testing that takes place on larger Oracle products. If you're concerned about the label of "production" versus "beta," I think you'd be pretty safe going with the latest release of OHJ, or we wouldn't have put it OTN for you to use. The developers have tested thoroughly. :) I'd recommend trying out 4.2.1 since it's got some substantial improvements over the 4.1 branch, and on the off-chance you run into problems, please let us know.
    - Ryan

  • Java versus j#: will java die?

    Hi there,
    Someone got a look in this article?
    http://www.winnetmag.com/Article/ArticleID/19379/19379
    Will Java die!?
    Thnx. Thom

    Yep. It's already dead, in fact. No companies are
    doing any Java development anymore, and there's aHUGE
    demand for J# developers as all the big players are
    doing 100% across the board conversion.
    You may notice the date on that article is 4 years
    ago. Why do you think the economy has been so lousy
    since around that time? It's because nobody's
    producing anything, or doing any R&D. All effortsare
    focussed on J#. It's bigger than Y2K.
    </sarcasm>Hey, where's you opening tag?
    I gots yer opening tag right here pal!
    </belligerence>

Maybe you are looking for

  • Plant on goods receipt document

    Hi gurus We have a situation where a purchase order is created automatically for intercompany stock transfer deliveries. On the PO when we default the plant to be P001. But  the plant on FI doc, created by the goods receipt,  is different than the on

  • How to cancell material document in decentralized scenario

    Dear All, How to cancel material document in a decentralized WM (WMS)??? I know that in a centralized scenario I should use MBST or VL09. Is there any solution? I would be grateful if you help me. Piotrek

  • Trim field's preceeding blank spaces in select statement

    Dear Gurus,   I have a select query like this.   DATA : znormt TYPE NORMT.   select normt into znormt from mara where normt EQ  Mymatnr. Mymatnr is coming from one of the Z table and the field contains 3 preceding spaces. Can you please tell me how I

  • Need to make sure

    Hi everybody and happy new year to all, I would like to make sure that I understand well how Time Machine is working before starting on the wrong foot.... My question is regarding on iphoto. SInce I shoot a LOT of pictures, my iphoto library becomes

  • The library module in 4.3 version does not show all the images

    The library module in the version 4.3 of Lightroom does not show all the images. They are marked with gray boxes instead of images. This is especially true of the images which I tried to import to Lightroom since I downloaded 4.3 a few weeks ago. If