Why Java is slow?

I am learning Java. I heard many people saying that Java is slow compared to other languages C,C++. What does that really mean?

Java is run on top of what they call a Java Virtual Machine (JVM). When you compile your code, javac produces a class file which contains a byte-code that can be interpreted and run by JVM later on (using java command). So, your java program run on (controlled by) another progam (JVM), unlike C/C++ excutables, which are run on the hardware. This scenario ensures compatibility with any platform you run your Java code on.
Basically it's like this :
| Java Classes |
|
| | |
| JVM for Win | | JVM for UNIX | | JVM for MacOS |
| | |
| Hardware |
But, no matter what your friends say, Java is a pefrectly suitable for almost any program that you'd write :))

Similar Messages

  • Why JDeveloper9i so slow

    hi.I am a chinese body.I used your soft --JDevelper9i 902.Now I have
    some questions .Could you help me ? I wrote some EJB code and they can
    run in the oc4j. Now I want to write more EJBs using JDevelper9i.So I
    add the old ejb to my project.Now my project have almost 100 EJBs.Then I
    run them. The JDevelper 9i ran very very slowly . It took 30 minutes to
    start the OC4J .Could you tell me why .Maybe I made some mistake .
    My computer's information :
    CPU P III 933
    RAM 256M
    OS Windows XP professional
    I am poor in English ! I wish you can understand me and ask my questions
    .Or you can give me some books or articles to solve my problem .
    thanks
    Tod

    The memory utilization of a Java process is principaly due to the complexity of the JVM, not the language itself. Much of the memory used is shareable, read-only and or execute only memory pages that the OS can share between Java processes. You can substantially reduce the amount of non-shareable memory consumed by adjusting the command line options to reduce maximum heap size, thread stack size, etc.
    The assertion that Java is slow is not supportable on the evidence at hand. Java's complex environment (the JVM) tends to cause Java programs to startup slowly. I wouldn't write a lot of simple command line utilities in Java (without using some sort of shared JVM) - C, Perl and the like are better at that.
    I build very complex systems with Java and the performance of these is quite good, on par with what you would find if implemented in C or C++.
    On the Unix side of things, Java GUI performance, specifically Swing - AWT if fine, is quite poor when executed on remote X terms. This is supposedly addressed by Java 1.4, but since I generally create server-side systems, I haven't looked into it much.
    That said, I do use a lot of Java Swing GUI applications (OK, mostly on Windows) and they perform quite well on my moderate (366MHz) notebook computer. Specifically JBuilder 4 and 5, and Together/J.
    Chuck

  • Why sun leader do not think about  "Why Java Web Start not be used widely"

    {color:#ff0000}Why sun leader do not think about "Why Java Web Start not be used widely"
    {color}
    Java Web Start was instruduced in jdk1.2, it's about ten years ago,But it's still not widely used--WHY?
    it's not because the design, it's becasue the code--the garbage code-- even the last version not work in many user computers,
    just not work suddendly -- noboday know reason--- if you do not believe, please google internet, many people suffered and suffering from web start!
    It's incredible that a famous big company like sun can not resolve an deployment problen in ten years that some very small company can do good work in much more short time !!!
    That' sun-- always say and design good things, then publish trouble and pain to their users. I really do not know what the sun's engineers are doing in so
    many years! -- why they do not know deployment is so important than others -- if deployment work fine, then the wrong thing can be correct easy !
    Sun, please do an famous big company -- give happy to user rather than pain !!! Please give us -- your users an stable and fast java web start to save us.
    {color:#ff6600}(Note: I use java web start to depoly our application, then receive endless complains, not work, slow and so on. now, we has no way just to give it up--design ourself's deployment-- that's also done by many pained people---just google it){color}
    Here is an desing suggestion:
    Client-end should be simple and stable, should let the server-end do complex thing .(now sun do opposite thing, they make Client-end complex, but server simple) ---it's because that Client-end will take widely effect on user's computer. update a few server is much more easy then update a amount of clients!
    Edited by: Jethro-Soft on Jun 30, 2008 8:49 PM
    Edited by: Jethro-Soft on Jun 30, 2008 8:52 PM

    Please check:
    http://joust.kano.net/weblog/archive/2006/04/06/why-i-will-never-deploy-with-java-web-start-again/
    http://kylecordes.com/2006/04/08/auto-update-no-web-start/

  • Why java file name and class name are equal

    could u explain why java file name and class name are equal in java

    The relevant section of the JLS (?7.6):
    When packages are stored in a file system (?7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:
    * The type is referred to by code in other compilation units of the package in which the type is declared.
    * The type is declared public (and therefore is potentially accessible from code in other packages).
    This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.
    When packages are stored in a database (?7.2.2), the host system must not impose such restrictions. In practice, many programmers choose to put each class or interface type in its own compilation unit, whether or not it is public or is referred to by code in other compilation units.

  • Why Java Web Start doesn't support Pack200 out-of-the-box?

    Hello All,
    Why Java Web Start doesn't support Pack200 out-of-the-box? I was hoping that Java 6 would make things easier by adding direct support for Pack200 in Java Web Start and JNLP without needing to use servlets, etc.? All my clients are Java 5 or above so I can't push the Pack200 compressed version of the jar to every single one of them and there is no selection process needed. But I can't do it because of the servlet or complex Apache server setup requirement (it would be a headache to get customers' web server admins to set up Apache or whatever web server that way).
    My question is why is there unwillingness to add Pack200 support directly to Java Web Start and JNLP so that you can start Pack200 compressed jars just like you would start any jar using Java Web Start? Is te a technical problem?
    Thank you,
    Mete Kural

    Hallo,
    I didn�t try it, but the webstart FAQ�s read:
    Can I use Pack200 compression with the JnlpDownloadServlet?
    Yes. The JnlpDownloadServlet distributed in the samples directory of the JDK now supports Pack200. If you deploy yourfile.jar along with yourfile.jar.pack.gz the packed file will be downloaded when the client is running Java Web Start 1.5.0 or later.
    http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/faq.html#217
    For further information you may want to look at
    http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/downloadservletguide.html#pack200
    The configuration of the server and the the servlet (as described in the second link) is as easy as it seems.
    I got it working on the first try and it was my first experience with websevers at all.
    Bye Schippe
    Message was edited by:
    Schippe

  • Why java is called java2

    why java is called java2 and another thing that i would like to know is why it was renamed to java from its previous name OAK
    Thanx
    Manish

    why java is called java2Not to sure about this one, but I think it was a marketing decision - I guess 'Welcome to the Java 2 platform' sounds better than saying 'Welcome to the JDK 1.2.1 platform' :=)
    and another thing that i
    would like to know is why it was renamed to java from
    its previous name OAKThere was already a patented product named 'OAK', so they had to rename it to something else to avoid the law.
    >
    Thanx
    ManishA brief history of Java:
    http://java.sun.com/features/1998/05/birthday.html
    http://www.ils.unc.edu/blaze/java/javahist.html

  • What is cookies.sqlite and why does it slow the start up of mozilla by a minute or so. I found it and deleted it,fixed the problem, but it reappears eveery time I restart mozilla.

    what is cookies.sqlite and why does it slow the start up of mozilla by a minute or so. I found it and deleted it,fixed the problem, but it reappears every time I restart mozilla.

    AVG reports these sqlite cookies each time firefox starts. they usually belong to tribalfusion or some other tracker. How do I block them in the first place. I thought firefox is a safe browser. Did not have this problem until I upgraded to 3.6.

  • Why does Telstra slow uploads speed down

    I have had ongoing issues with my internet connection over the last 18 mouths.Having a upload speed of 450/650 Kbps  very slow no good for gaming an down load of 8/11Mbps down load if more than I needTo the point I have spent good dollars try to insuring   that the infrastructures and the Asset Integrity with in house are in best condition this includes the replacement and work listed belowReplacement of the Wi-Fi system to a Cat.6 cabling at a cost of $2,300Replacement of the modem with a high speed 1G port modem at cost of $ 475Replacement of the fly-lead for the Telstra house connection to the new wall socket a cost of $360Total cost of $3135 this spend was braced on Telstra recommendation as the problem was with my part of the connection after a large number of call to my internet provider I at last had a appointment with a Telstra Tec to carry line testing and fault finding .At this point if no fault was found  I was the be billed at $60 per 15min or part off and travel cost as I live in Bullsbrook WA this may I high . Lucky for me a fault was found in the exchange and reconfigured and the speed and the Exchange improved   to 22Mbps down and 15 Mbps up an outstanding numbers >test at the house 15Mbps and so 5 / 7 Mbps loss for the Exchange to house don’t to good but still very happy with it BUT the upload was 650 kbps /750Kbps and please remember this testing was carry out by Telstra with good equipment so at this point I ask why the upload was so slow? After spending over $2000 and lot of time on the phone only to be told that Telstra slow the upload speed down so the max you can get is 1 Mbps and the only way you can increase this is by paying for a business line but you still may not get any more than 1MbpsThis is only a very small part of the story SO I LIKE TO ASK WHY IS TELSTRA SLOWING ME DOWNIf you like to know more please let me know

    Hi bigdave618, 
    The simple answer is, that's the way the system and hardware is designed, all ISP's are the same. Uploads are limited to around 1Mbps. If you wish to get higher upload speeds you can see if Cable Broadband or NBN are available in your area as these systems allow for higher upload speeds.
    Upload speeds are generally slower than download speeds because of the fact that most internet connected equipment is asymmetric. Asymmetric means that any one packet of data can either go in, or out, but not both ways at the same time. Since most internet users are receiving more data than sending, the internet connected equipment has shifted the higher majority of the signals to go toward downloading.
    If you wish to find out more about ADSL I have added a link to a Wikipedia article below along with the link to the NBN and Telstra websites so you can check to see if Cable Broadband or NBN is available in your area.
    ADSL Wiki article: http://en.wikipedia.org/wiki/Asymmetric_digital_subscriber_line
    Check for available Telstra Cable Broadband: https://www.telstra.com.au/broadband/home-broadband
    Check to see if NBN is available in your area:  http://www.nbnco.com.au/connect-home-or-business/check-your-address.html
    - Ben 

  • Why java is platform independent ?

    what is the meaning of java is platform independent ? is it just because of java code can be run in windows/linux/unix platform ? but then C/C++ also can be run in windows/linux/unix . so why those are not called platform independent ?
    why java is called platform independent ?

    c/c++ creates object code . similary java creates bytecode . java uses interpreter JVM to execute . similary c/c++ object code also executes in any platform. so where is the real difference ?
    the classes do not need to be recompiled for different platforms. what do u mean by this ? ".....classes ( i.e bytecode) dont need recompilation ..." .....ok....but same thing is true for C/C++ object code also !! they also dont need recompilation.
    where is the difference ?

  • Blog post: Embedded Software: Disruptions Ahead - Why Java makes sense

    All,
    You may be interested in this blog post I did two days ago, which talks about the challenges in embedded software design and why Java makes sense for embedded software engineering:
    https://terrencebarr.wordpress.com/2013/08/05/embedded-software-disruptions-ahead/
    Best,
    Terrence

    (bump)

  • Why java only can display GIF file not jpeg and BMP ??

    Did anyone know why java only can display GIF file not in jpeg and BMP ?? This is because the quality of GIS is not as good as Jpeg and BMP
    any code to load the display process ??
    thx guys !!!

    you can do jpegs but im not sure about bmps.
    The only thing ive noticed is that java cant support transparent jpegs, only transparent gifs
    Jim

  • Why java allow start() method only once for a thread

    Hi ,
    Why java allows start method only once for thread . suppose
    Thread t = new Thread();
    t.start();
    say at later stage if again we call t.start() IllegalStateException is thrown , even though isAlive method returns false.
    Hence the question , why start() method is allowed only once.If you need start a thread , we need to create a new instance.

    Really. Why do you think that? Do you have any evidence? It is one of the first things I would think of, personally.Considering that the Thread API doesn't allow you to specify a stack address (only stack size), I think it demonstrates they wanted to remove that capability from their Thread API all together. That missing "capability" makes me believe they want me to believe it's not something I need to worry about when using their API... I think the exact semantics of the Thread class and its methods were driven by how to make it most understandable and usable for their customers. I'm certain this issue was one of many that was given considerable thought during the design and implementation of the JVM and the underlying runtime classes.
    Do I have any evidence? No. But if you can point me at some first-hand information on this, I'd love to read it. Most of what I've found is second or third hand accounts. (and I mean that sincerely, not as a smart-ass remark or rebuke of your comments).
    On the one hand you seem to think the Java API designers are idiots, on the other hand you think that they should be. I can't make it out.I thought my position was that the Java developers were talented enough to implement platform in whatever way their API called for; hence, the designers made a choice about how they wanted their API to be used by their customers. They decided which capabilities they wanted to include or exclude, and created an API that was consistent with their vision for this technology. While I'm certain technical limitations had an effect on the API design, I certainly don't think the API was dictated by the them.
    I think the current design of the Java Thread API was a reflection of their vision to make Threading easier and more accessible to Joe Programmer, not limitations in the implementation. I never said it was wrong or that I could do better... I just said I think they could have done something different if they decided it would have made for a better customer experience. But hey, maybe I'm wrong.

  • Why java is free?

    I don't understand why java technology is free to download, and even more of this, the source code is available.
    I think sun can make a lot of money from us. (without giving ideas)

    They're trying mic$ofts trick - for years micro$oft offered wondoze on easy to copy disks, with little or no security (even though they could have implemented some kind) knowing that people would pirate it, and spread it around very quickly. Then, when most of the computing world is hooked on using windoze, they upgrade to a flashy secure version that you have to pay loads for. It was a gamble, but certainly paid off. What sun are doing is the only possible tactic for them at the moment, which is to spread java as much as possible to ensure loads of people use it - they are not doing this for fun, or the love of the language, but purley and simply as a business strategy.

  • Why Java is  following Unicode & not ASCII standard?

    Hi all,
    I am new to Java as well as to this forum.
    Could you please tell me why Java is not following ASCII format?
    And why is it following Unicode?
    Thanks,
    Reni

    Unicode is chosen because it's an abbreviation for Unique Ode, which means that it provides a special sort of poetry to give Java an aura of mystique, intelligence and worldliness that sets it apart from other languages.
    To support languages and characters other than English.Who doesn't read/speak English, really?! And why isn't there multiple language keywords for Java. Why can't I write code en Espa?ol?
    p?blico vac?o hagaAlgo(Secuencia s) {
       para(nent i = 0; i < s.longitud(); i++) {
          Sistema.fuera.impresi?nL?nea(i + " = " + s.car?cterEn(i));
    }(int abreviated for "n?mero entero")
    Message was edited by:
    bsampieri

  • Why java is strongly typed language

    Can any one help me to answer the following query:
    (1)why java is strongly typed language?

    Can any one help me to answer the following query:
    (1)why java is strongly typed language?http://en.wikipedia.org/wiki/Strongly-typed_programming_language

Maybe you are looking for

  • Keynote to iMovie '09 Text is Fuzzy at Full Screen View

    I haven't seen any postings like this so I'm starting a new thread... I have a keynote with mostly text and transitions (slide size1024x768) I exported to QT (custom full size, H.264, 30 frame rate, 24 key frame rate, data rate of automatic and compr

  • Opening any report in SPM shows Server Error

    Hi Experts, We have recently upgraded SPM from 2.0 to 3.0 SP3, where when we click any report a small pop-up on the right corner shows "Server Error". We have taken the http watch trace and it shows as 404 - for URL - http://<systemhostname>:<port>/s

  • Attaching/Detaching libraries with Java API

    Hello, In my forms (Forms10g), sometimes, libraries had been attached in lower case although files are in upper case. This causes compilation errors on UNIX systems. I'm trying to detach these libraries with Java APIs and then reattach them in upper

  • White screen issue on iPhone 4S?

    Recently when I tried to use my iPhone the screen just turned completely white. I have no idea why. The screen is still functional in that if I receive a call, I'm still able to swipe to pick it up. I even tried a hard reset by holding the power and

  • Netra 440 - pci@1e failure msg at OpenBoot Diagnostics

    Hi, We have here some problems at a new netra 440. In the OpenBoot Diagnostics we receive the msg: WARNING: Device /pci@1e,600000/ide@d being marked with 'status' == fail SC Alert: /pci@1e,600000/ide@d fail When the OpenBoot Diagnostics are finished