Re: Java speed: Reality versus theory?



Matthias Kaeppler wrote:
> Hi,
>
> I just saw this thread popping up asking about speed comparison between
> Java and Delphi. I'd have a slightly different question:
>
> How come so many people claim Java to be so fast, even write papers
> about how great JIT and the Java runtime in general is compared to other
> languages, but still, each and every Java application I have /ever/ used
> is either slow or so /unbearably/ slow that you can't even work with it
> without ripping your hair out (I don't want to call names, but there are
> quite some very popular development tools written in Java which run
> awfully slow on my 3GHz machine)?
>
> All those language and tech comparisons are nice and good (for example I
> have read a paper which claimed that heap allocation in Java would be
> way faster than in C++, because it would only take 10 machine
> instructions for the Java virtual machine, but up to 100 in C++), but if
> you leave out the theory, Java doesn't seem to even come close to the
> speed of say, a well written C++ program.
>
> How come? I think one reason is that Java almost encourages sloppy
> programming. Creating unnecessary temporaries or locals because "the GC
> takes care of it anyway" seems to be common practice in Java; in C++ you
> think /twice/ before allocating anything, especially on the heap.
>
> Any other ideas? I really think it's an interesting situation: One party
> claiming (even proving) Java to be fast, while actual real-world
> applications show that it's clearly not.

I think the main reasons are:-

* The GUI libraries AWT and Swing are not very fast.(and not really
intended to be)
* Startup is slow because of the overhead of starting up the virtual
machine
* Java programmers often write very OO code and attempt to generalise
everything.

I'm sure others know much more about it though. If anyone who has
experience of these things knows otherwise listen to them not me.

.



Relevant Pages

  • Re: porting from C++Builder
    ... that's correct and there is a very strong reason for taking this ... the java was growing and, obviously, microsoft initially tried to ... that crowds of developers would rather stay and develop windows applications. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: JVM/Java memory footprint
    ... I found that if I use Java for developing the CLI ... application I will be exhausting the memory of our Application Server ... Just to mention the architecture,users use ... what WHAT specific REASON do you have to make ...
    (comp.lang.java.programmer)
  • Re: 7.0 wishlist?
    ... I felt the former was a better fit, since language design/change is an issue of interest to the programmers that use the language, and language changes are really specification changes that require tools like the compiler to be updated as side-effects. ... It was considerably more on-topic than some of yours have been (notably the ones that are 80% personal attacks by dry weight and only 20% Java programming related -- and high in saturated fat too no doubt!). ... If it is not your actual attitude, then your posts to this thread either are an unrepresentative sample or communicate your true feelings poorly for whatever reason. ... than you were in your original posting. ...
    (comp.lang.java.programmer)
  • Re: kilyx
    ... somewhat compatible with, for good reason) ... There's a difference between what the IDE is built in and what GUI ... Borland built a C++ IDE around a Java core ...
    (borland.public.delphi.non-technical)
  • Re: C is too old? opinions?
    ... Is Java used for real-time systems. ... Go on then - I would like to know how garbage collection affects ... A good reason, showing thought and reason. ...
    (comp.lang.c)