Java. Slow...?

Hello.
We have been trying to make some applets for networking and displaying text, almost like telnet.
Thing is, java seems to be very slow. It seems like our code is running slow with a pentium 200 mmx through internet explorer (which seems to be the fastest browser for java). The same code, through c/c++ seems to run so very much faster on a simple 486 computer, not through a browser off course.
The use of the program/applet needs speed too, so its a relevant factor.
Is applets really this slow and will there be a faster future?
It would be so great if it were possible to make fast applets :)
Try the applet out at www.sharune.com/started.shtml

Well if you're using an old p200 then if you make it a java application then you can run it on its own and not have the brower slowing things down..
Other than that there could be other factors slowing things down (certain swing and awt components are serious bottlenecks for speed).

Similar Messages

  • Why is java slower than C and C++

    Hi Guys:
    I would like to know why Java is slower than C and C++ in terms of compilation speed...
    Does it have to do with the fact that Java compiles to byte code first and then the JVM translates byte code to machine code which your processor can understand. whereas C and C++ compiles directly to machine code...
    Any ideas on that,...let me know..

    It's not necessarily. I would suggest that it always is; whencomparing
    specific tasks.I would suggest that is never is (significantly)
    when non-trivial and non-specialized applicationsare
    involved. Requirements and design always have a
    much greater impact.There's no doubt that the design is the most
    important
    aspect when writing a program, but assuming those
    things
    are equal, the fact is that a c program will be
    faster.Yes, but given the fact that there is almost zero chance that the requirements, design and implementation will be optimal, it means that the real differences between the languages are insignificant compared to the real difference caused by the other factors.
    In the theorectical world C/C++ is faster. In the real world, most of the time, it is not significant.

  • Why is Java slow or causing Lion to be slow?

    I did a fresh install of Lion and installed all the needed updates including the APPLE java update plus the malware remover that came with it. Since then a lot of Java games are SLOW. I'm not sure if it's actually java or a Lion update that's causing this issue. Someone suggested I remove my printer software but I dont remember that causing issues before the fresh install. It seems it happened after Apple updates.
    Any help is appreciated.
    Thanks

    It is slower because it is an interpreted language. There have been many improvements to the language from compilation and through newer JVM's that further optimize the code. It is someting you must work w/ when you use the language.

  • Why is java slow?

    Why is java so slow? I think sun needs to make a big improvement on the speed of loading a java program/applet.!!

    It is slower because it is an interpreted language. There have been many improvements to the language from compilation and through newer JVM's that further optimize the code. It is someting you must work w/ when you use the language.

  • Java slow to exit

    I'm running Eclipse on a Win XP desktop w/ 384mb memory. The Win and Java cache are probably 1 gig each. The app runs slow as you can imagine. Even worse, the exit time is very long. Does java need to write to the disk on exit?

    OK. I guess what I'm trying to do is use an IDE (Eclipse) which runs on Java, to compile apps for java. I've written some small apps using a text editor and compiling the source from the dos cmd line. Seems resonable. But as soon as I get into one of these IDEs the system requirements goes into the gigabytes. Is there an option for a lightweight dev environment?

  • Java Slowness (McAfee)

    A shot in the dark here, but has anyone found a work-around for the McAfee + JFileChooser slowness?
    I'm having no issues with Java itself, but I know I'll have more sanity here than on a McAfee forum.
    When a JFileChooser dialog opens and there's a bunch of zip or jar files in the view, McAfee (Mcshield.exe) jumps to *100%* CPU in TaskManager for a minute or so, and the computer becomes unusable.
    OS: Windows XP SP2
    JVM: 1.6.0_05
    I remember a work-around that involved changing a windows setting, but I'd rather deliver a permanent solution to our anti-virus guy that just fixes this moving forward.
    Thanks for any insight.
    -Tres

    Yes, turn off the on access scanning feature.

  • Java slows down firefox 5 & 6. Was OK in 3.6

    Running a page with java cause the browser to become unresponsive. This started happening in ver 4 and still does it in ver 6.
    It worked fine will allthe ver. 3's
    I am running XP pro sp3 on an I5 machine. How do I fix this?

    I've noticed that working with tab groups instead of my preferred mode of multiple windows mitigates this problem dramatically. What used to take hours now takes a couple days before the memory has blow out of a 4 gig 64 bit Win 7 machine.
    This is an observation not a solution. Memory problems need to be fixed. Teaching another browser to work my way is tedious. But I'm about ready to abandon FireFox. (For what it is worth T'bird does not seem to have this problem. Perhaps that would help point to the memory leak.)
    {^_^}

  • RDP and JAVA (SLOW ON TYPING AND SCREEN BUILD)-CTRL-ALT-END-ESC speeds up

    Any news what's the problem in a 2003 environment?
    Only after using the CTRL-ALT-END-ESC combination things are speeding up.
    We've got following installed on the server:
    JNLP Runtime Setiings
    1.3.1_19
    1.5.0_06
    Both enabled and 1.5.0_06 is enabled as system.
    Tried different combination and this seems to be the fastest, but still not good enough,if you launch it locally on theserver, it goes very fast,so it has someting to do with RDP,
    Any help?
    Greetings,
    Dre

    What's the problem with what? 'It' being what? and RDP having what to do with it?
    Just curious ... call me old-fashioned.

  • Collaboration On Shared Code File Slow

    I heard about all of the hype of collaboration, and I had a Java project that my friend and I had been working on. We both set up Java Studio Enterprise 8 on Fedora Core 5 workstations, and one of us ran the collaboration server.
    After signing in and beginning a shared code file, we noticed that the code line synchronization is extremely slow, with update times in lines of 5,000 - 10,000 milliseconds. Is this normal? Is there any way to configure the server such that changes made by one user are reflected quicker to the other users? Or is it just "Java slow" and there isn't anything that can be done? I personally was expecting something a bit more realtime (e.g. 50-250 msecs) than a few thousand milliseconds.

    The following are known performance issues that may be of relevant to your situation:
    http://collab.netbeans.org/issues/show_bug.cgi?id=62291
    http://collab.netbeans.org/issues/show_bug.cgi?id=69392
    You can try using later versions of the IDE:
    NetBeans 5.0: http://www.netbeans.org/downloads/index.html (Collab is not bundled with NB5 product; you will need to connect to the update center and download and install the module).
    Or Sun Java Studio Enterprise 8.1 Beta (http://developers.sun.com/prodtech/javatools/jsenterprise/downloads/index.jsp)

  • Wouldn't jvm slow down programs?

    Hey, I have a question? Wouldn't the virtual machine slow down the program you are writing...because the code has to go through a whole nother layer instead of being compiled straight to assembly like C...

    Hey, I have a question? Wouldn't the virtual machine
    slow down the program you are writing...because the
    code has to go through a whole nother layer instead
    of being compiled straight to assembly like C...It's not that simple.
    * That layer can be made very thin, so that in most cases the overhead is negligible.
    * Modern JVMs use runtime optimization. Compiling C code to native executable means all the optimization will be done at compile time, without the ability to adapt to the runtime environment, execution patterns, etc.
    "Is Java slower than C" is a very broad and meaningless question. In the very, very general sense, yes, native code will execute slightly faster than code run by a VM. However, there are many other factors involved, and most of the time the performance difference in either direction is too small to be worth considering.

  • Y not compile to .exe ?

    Hi Friends,
    Why can't we go for a compiler which generates .exe instead of .class files ?
    Let the code be platform dependent, but if we know that our application is gonna run on a given OS & given hardware configuration, can't we generate a .exe specific to that configuration so that the application can be optimised in speed and performance ?
    For this to work out we need configuration-specific jvms and built-in jar files.
    And finally is java slower than C++ by any chance ?
    Thanks a lot

    Why can't we go for a compiler which generates .exe
    instead of .class files ?You can, you just need another program which does it.
    Java has other ways of packaging applications e.g. Jar and JWS which are platform indpendant.
    Let the code be platform dependent, but if we know
    that our application is gonna run on a given OS &
    given hardware configuration, can't we generate a
    .exe specific to that configuration so that the
    application can be optimised in speed and performance ?The JVM compiles the code to the platform at run time. What you suggest can make install simpler, but does not provide performance improvements. In fact it can mean you cannot use performance improvements provided by a JVM produced after you build you .exe.
    And finally is java slower than C++ by any chance ?Can be. For CPU bound applications C++ tends to be much faster. For most real world applications I would suggest it is possible to deliver a Java application faster than the same application in C++.
    For a limited total budget for a project, Java can be faster. i.e. you can spend more money on the hardware for the money you save in developing the application.
    This depends on the applications requirements of course!

  • Best crossplatform language?

    Hi
    I'm interested in making a crossplatform gui application. SO I've started to try and learn java. However I keep coming across posts on ruby and python and there seems to be much talk about these being better/easier etc.
    I'd be interested in hearing what people on this list have to say on the topic. The object is to be able to develop an application that can run on both a mac and a windows machine .. a write once run anyhwhere application .
    Personally I like perl but making a crossplatform application with perl seems very difficult since my development platform is Mac and Perl/Tk seems to have issues with the mac.
    I'm not so much interested in a flame war here as some pros and cons.
    From what I have been able to deduce java seems a reasonable avenue since it pretty much runs anywhere and most users on windows allready have javaruntime installed. But maybe I'm missing something.
    Ofocurse in the best of worlds I could make a gui using Xcode tools and with the push of a button port it to windows...alas that is not to be

    Sounds like you recommend C# ..
    No, not quite. I recommend not trying to go off on your own (relatively speaking) with user interfaces. C# was designed for .NET and vice-versa. If you use C# with .NET, you will be using the same language/architecture as the vast majority of new MS development.
    There is still quite a bit of VC++ with MFC around, but don't start on that. It just isn't worth it. For MS, C# and .NET are the future. Don't fight the future.
    ofcourse that still
    means one has to learn two languages at the samt time
    .. both C++ and C# .. at least if one wants to live
    in the mac world. Seems a shame there isnt a C++
    framework that could be used for gui on windows. But
    am I right in understanding that C# is "newer" than
    C++ ?
    Not really. It is just that "vendors" (MS and Apple) "encourage" developers to use different tools for User Interface development. You can use whatever tools you want. But if you chart your own course, you will have to solve all your own problems. The user-base for non-standard development architectures is very small.
    The point I'm trying to make is that the language differences between Java, C++, Objective-C, and C# are very, very minor. Minor is even too strong a word - insignificant is better. The various UI libraries are, however, radically different. Java Swing is nothing like the Java Eclipse SDK. Both are radically different than anything else. I haven't used QT, but I suspect it is radically different from everything else too. The same is true with MFC and Carbon. Cocoa and .NET seem to be relatively close.
    That's all I'm going to say on the matter. You have asked for advice and I've given my humble opinion. People are already starting to get into Java "slowness" religious wars. I don't have time for that nonesense. I call 'em as I see 'em. I do my new development in Objective-C++ on the Mac and I plan to use C# and .NET on Windows. I have spent many, many years doing cross-platform libraries in C++. I don't think it was worth it and don't plan on doing that anymore.

  • Java web start application runs too slow...

    Hello,
    I am new to Java Web Start. I have created a java web start application and when i enable web start from local Execution, then it works perfectly well. But when i upload it on server and then download the application, then it is too too slow...i mean it takes minutes to get the output on clicking some button....my jnlp file is as under:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <jnlp codebase="http://(web server code base)" href="launch.jnlp" spec="1.0+">
    <information>
    <title>ERD</title>
    <vendor>Deepika Gohil</vendor>
    <homepage href="http://appframework.dev.java.net"/>
    <description>A simple java desktop application based on Swing Application Framework</description>
    <description kind="short">ER Deign Tools</description>
    </information>
    <update check="always"/>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+"/>
    <jar href="ERD_1_2.jar" main="true"/>
    <jar href="lib/appframework-1.0.3.jar"/>
    <jar href="lib/swing-worker-1.1.jar"/>
    <jar href="lib/jaxb-impl.jar"/>
    <jar href="lib/jaxb-xjc.jar"/>
    <jar href="lib/jaxb1-impl.jar"/>
    <jar href="lib/activation.jar"/>
    <jar href="lib/jaxb-api.jar"/>
    <jar href="lib/jsr173_api.jar"/>
    <jar href="lib/ant-contrib-1.0b3.jar"/>
    <jar href="lib/jaxb-impl.jar"/>
    <jar href="lib/jaxb-xjc.jar"/>
    <jar href="lib/FastInfoset.jar"/>
    <jar href="lib/gmbal-api-only.jar"/>
    <jar href="lib/http.jar"/>
    <jar href="lib/jaxws-rt.jar"/>
    <jar href="lib/jaxws-tools.jar"/>
    <jar href="lib/management-api.jar"/>
    <jar href="lib/mimepull.jar"/>
    <jar href="lib/policy.jar"/>
    <jar href="lib/saaj-impl.jar"/>
    <jar href="lib/stax-ex.jar"/>
    <jar href="lib/streambuffer.jar"/>
    <jar href="lib/woodstox.jar"/>
    <jar href="lib/jaxws-api.jar"/>
    <jar href="lib/jsr181-api.jar"/>
    <jar href="lib/jsr250-api.jar"/>
    <jar href="lib/saaj-api.jar"/>
    <jar href="lib/activation.jar"/>
    <jar href="lib/jaxb-api.jar"/>
    <jar href="lib/jsr173_api.jar"/>
    </resources>
    <application-desc main-class="erd.screen1">
    </application-desc>
    </jnlp>
    I dont understand the reason. Could you please help me out.
    Thank you,
    Deepika Gohil.

    Check your web server's access logs to see how many requests web start is sending for each jar. After you've loaded the application the first time, for each subsequent launch, if you've got everything configured right, you should only see requests for the JNLP file and maybe some gifs because web start should load everything else out of the cache (if you're using the version-based download protocol). Or if you're using the basic download protocol, then you might see requests for each jar file, but even in this case, if your web server is prepared to evaluate the last-updated attribute for each jar request and for jars that have not changed, respond with no actual payload and a header value of Not-Modified, then that should run almost as fast.
    You might also want to consider changing the "check" attribute of the "update" element from "always" to "background" for a couple of reasons. It should allow your app to start sooner (but this means that you might have to launch once or twice after an update is applied to the web server before the update shows up on the workstation). Also, my impression is that "always" is broken and prevents web start from ever checking to see if your jnlp file has been updated if you launch your app from a web start shortcut - launching from a browser is less likely to have this problem, depending on how often your browser is configured to check for updated resources.

  • Need a lot of custom JComponents, but Java just too 'slow', other Solution?

    Hi folks,
    first of all i'll try to explain my problem (although my english is quite bad)
    We're programming a tool for visualising graph algorithms (df search, strong connected components, transitive reduction etc.) For that, we got a drawing area (derived from JLayeredPane) which contains the Nodes and the Edges of a graph (for all that don't know what a graphs is, just imagine these nodes as numbered circles, and the edges as directed lines from one node to another).
    Both parts (Nodes and Edges) are derived from JComponent, because a) need MouseEvents on these Components and b) we need the ability to add them to a container (like JLayeredPane)
    An absolute requirement is that you can directly click on the edges (to mark them, or delete them etc)
    Another point which needs to be mentioned, the edges maintain a (invisible) polygon which lies around their line, this polygon is sensitive for mouseEvents.
    Now there are two main problems:
    * all these edges have (due to JComponent) (possibly) huge invisible rectangles (the only thing that really matters is the line from one corner of this rect. to the other) ...so if i got lets say a graph with 10.000 edges, there are a lot of edges that overlap (nearly 10.000 :) ) ... but only the Edge-object on top receives the MouseEvent (but perhaps the user wanted to cklick a edge that lies below the top-edge!) .. at the moment, the program looks at all edges below that which received the MouseEvent and checks wether the 'mouse'click' hits a polygon, If it does, the top edge dispatches the MouseEvent to that edge. (furthermore, due to the depth-order in a Layer of a JLayeredPane, we only need to look at all edges that are really below the egde that received the mouseEvent)
    This all works great for 'small' numbers of edges (approximately 1000-2000) but with a rising number of edges this attempt gets slower and slower (it takes 1-3 seconds to evaluate a single mouseclick on a Sun Ultra 5/333)
    * the bigger problem is, that if i got 10k+ JComponents in a Container Java gets really slow, just adding these 10k JComps. (to the JLayeredPane) takes some minutes?! Furthermore java consumes up to 200+ MB main memory in this situation.
    One solution we are currently thinking about is to implement these edges as 'pure graphics'-objects (for example the Container just draws all edges).. this probably solves problem # 2 but # 1 gets even worse (no depth-order, some more coordinates hassle)
    So, i hope someone can give me a hint for this problem or someone has had a similar problem before and has a good solution? (if the problem isnt clear, just ask)

    I worked on an application once that had a similar structure as yours, but we were only scaling up to about 1000-2000 components. The problem that we identified (and that you have, no doubt, also identified) is that you are searching all of the child components on every hit test/overlap test. What we did was to subdivide out outermost container so that it had a couple of dozen children, each of which then parented some of the original child components: this cut our search space for every hit test dramatically. We had the advantage of having collections of child componenents that we knew would not overlap so our first level containers did not overlap -- you may need your first level containers to overlap, but even with this, you'll still be able to much more quickly identify components in the immediate region that should be checked individuall.

  • Slow, not responding, and not compatible with java etc since updating to 6.0.2. Love Firefox normally but am not happy.

    Since updating to Firefox 6.0.2 i have not been happy with the way it is running. It is incredibly slow, keeps telling me its 'not responding' and looking at my add-ons, seems incompatible with the java console, with skype click to call, etc. I also seem unable to look at complex 3d graphics online, which used to work fine. Now they end up crashing the system.
    This is a big problem for me, and i have noticed (on your other forums on this website) that others are having similar problems.
    Is there any thing i can do before this problem is eventually fixed by firefox?

    i tried. like i said, only when i disable all i can watch youtube. i have not checked settings of extensions but i am not an it specialist. i probably would not know what to look for.

  • Slow Printing from Java (AGAIN!)

    While Java printing seems to be somewhat improved over what I've seen in the past, one of our customers has several end-users who need up to 45 minutes to print a simple, ten-page, pure text report, and some have been complaining about missing pages and/or poor print quality.
    Our product offers users a choice between printing reports directly, or generating PDFs using the GnuJPDF library. In my own tests, I've found that if I print an eleven-page report directly, it sends a full megabyte to the printer (an HP LJ6MP, presumably running in PostScript mode), and takes two and a half minutes to print. If I generate a PDF, it takes two and a half SECONDS to genrate the PDF, and if I then print the PDF from Acrobat, it sends little more than a third of a megabyte to the printer, which then churns out pages as fast as it's able to, in well under two minutes.
    In effect, Sun's own Java AWT printing system, even after considerable improvements over several years, is STILL considerably slower and clunkier than a not-quite-public-domain jar.
    What's wrong with this picture?

    try...
    java.lang.InheritableThreadLocalHmm. I admit I haven't looked at this thread in a while.
    But what does an "InheritableThreadLocal" (or an ordinary "ThreadLocal," for that matter) have to do with Java printing?

Maybe you are looking for