Re: How fast is Java?




<tabun@xxxxxxxx> wrote in message news:WMSdnQCcx-huglrZnZ2dnUVZ_vudnZ2d@xxxxxxxxxxx
Jean-François Blais wrote:
Many must have asked that question. I intend to write a few programs
which will be CPU intensive. I know a little of Java. Would a language
that yields native code, instead of bytecode perfrom much faster?

I recently wrote a minuscule C program containing one loop using a few
variables, and an equivalent java program, which was nearly as fast as
the C program. Unexpected result to me. When is Java slower?

See http://groups.google.com/group/comp.lang.java.advocacy/msg/4afdc4eda32ca731


What kind of program will I write? Programs for myself only. Only text,
no graphical user interface; batch processing; virtually no I/O. Mostly
comparing, and adding integers. Random access to memory.

Should I use my already installed Javac, or consider using another
language?

I'd recommend you write in whatever language you are most comfortable in (unless your goal is to learn Java, in which case, write them in Java). Don't worry about optimization until you actually notice a problem in performance. And then, look at optimizations at the algorithm and data structure levels before worrying about switching to a "faster" language.

- Oliver

.



Relevant Pages

  • Re: For a fast implementation of Python
    ... a scripting language such as python may be the wrong tool. ... Java generally produces bytecode that is then run by a virtual machine, ... optimization in Java generally hinges on just-in-time code generation ...
    (comp.lang.python)
  • Re: Comparing Lisp conditions to Java Exceptions
    ... All the ISO standards in the world will not make the world ... Nothing keeps you from annotating your program with exceptions based on what ... language should adhere to your theory. ... Curiously, although you don't say it, Java has the opposite problem. ...
    (comp.lang.lisp)
  • Re: casts
    ... This is why most shit programmers refuse to learn languages including ... C Sharp and Java. ... compiler in a later edition of Visual Basic, ... language for processing data. ...
    (comp.lang.c)
  • Re: C, really portable?
    ... > Wait, is Java a modern language superior to C, or is it still ... It is a much better OO language than C++, ... It depends what you are doing, Java aims for rigorous portability - the same ... regardless of platform. ...
    (comp.lang.c)
  • Re: Is anybodys favorite computer programming language not included here?
    ... to talk about getting me some paying work writing Java classes. ... and could be copied to a script (as in Java BeanShell or Lisp PROG). ... >> please post a followup saying what language it is, ... Server: "Mother, ...
    (comp.programming)