Java VM & .NET Performance Comparisons
johnhennessy writes "Just came across some good virtual machine performance benchmarks (on Mono's mailing list). It covers executing java bytecode via a host of different Java runtimes and also the mono runtime. Not only does it give numbers for IBM's runtime (1.4.2 and 1.3.1), Sun's runtime (1.5.0 and 1.4.2), GCJ, Mono, Jikes and much more! These numbers are also given for both Intel and Opteron (where relevant). Before the flames begin, don't forget to read the authors description of how the benchmark was carried out. Hopefuly this should inspire educated discussion on ones favourite JVM/CLR."
These are nice evaluations of "free" JVMs.
But I don't see commerical and highly optimized products like JRocket on there (BTW, I think the JRocket JVM is free, support costs).
It's no surprise Sun's JDK seems to perform the best out of the other versions. They know Java the best since they created it, and thus are able to optimize it better than the other versions. This would probably change if Sun had a more open licensing scheme for Java. Just my two cents.
US businesses that currently accept chip and PIN/signature
OK, so I'll admit I've not *read* the article, but fairly throughly scanned over the first 2-3 tables, and graphs.
But, what are those numbers?
I'd presume they are meant to be seconds, but the difference is so vast it can't be. Can it?
What surprises me is that GCJ is never faster than a 'real' JVM. You'd think that natively compiled and optimized code would be faster than an interpreter. I guess there's optimization work to be done in gcjlib.
Tiller's Rule: Never use a word in written form that you've only heard and never read. You will end up looking foolish.
You'd think that natively compiled and optimized code would be faster than an interpreter.
Code run in modern Java VM's is not interpreted...it's compiled on the fly with whatever performance optimizations are appropriate for the particular machine at that particular point in the execution path.
I'd also be very curious to see an independent mark of BEA's JRocket JVM, which is supposed to blow Sun and IBM away on X86.
credo quia absurdum
I've run probably over 100 benchmarks comparing IBM and Sun jdk for JESS using manners and waltz benchmark. In all of my tests using -server and client for jdk1.4.2, IBM was on average 20-30% faster than Sun. Makes me wonder if there was something specific in the JESS test, which gave Sun the advantage.
Sorry, this is slashdot.
What these benchmarks suggest to me is that C#/.NET is fully competitive in terms of performance with the best Java implementations, and C#/Mono is good enough for most work. In fact, given the additional language features of C#, it may well be easier to write fast code for many compute-intensive problems using Mono than Java today.
The level of performance of Mono is even more impressive given how young the project is; at the same point in time in its evolution, Sun had barely managed to produce a JIT compiler.
If you want C, you know where to find it: /usr/bin/gcc is a good guess.
If you want Java, then use Java.
One of Java's most significant advantages is that it doesn't expose pointers or dynamic memory allocation to the programmer. This is a Very Big Deal, because there are only two kinds of programmers out there: the sort who know they can't be trusted to never leave a dangling pointer or a memory leak, and the sort who are living in denial.
Why in the world would you want to throw away one of Java's major advantages just to save yourself the minor inconvenience of having to learn something new?
Most of the good programmers that I know--and, without exception, all of the great programmers I know--are fluent in more languages than they have pairs of clean socks. So my advice to you is simple:
Abandon C. Really. For the next year, don't touch C. Walk away from it. Use Java or C# or LISP or SML/NJ or Ocaml or Prolog or FORTH or Fortran95 or whateverthehell floats your boat, but for the next year, just get away from C. Explore what else is out there. Learn other languages. Become fluent in them. See what new things they give you. See how they're better than C. See what C does better than them.
Avoid COBOL if at all possible, though.
- The default character encoding resulting from your particular combination of JVM and platform will be correct and non-lossy every time the program is run (e.g. not in Windows, which defaults to ISO8859-1), or;
- You're certain that the file contains only 7-bit ASCII.
Readers and Writers deal with characters, whereas InputStreams and OutputStreams deal with bytes. FileReader and FileWriter are miscreants that should be deprecated, because they hide a very important implementation detail, namely that they always use the platform's default character encoding, which is often lossy.If you want to read characters from a file (or socket) you need to come up with some way to agree on the character encoding and specify it precisely. Not even HTTP does a good job of this--you don't know the character encoding of a request or response until the Content-Type header has been transferred, and often not even then.
What's the character encoding for URLs and domain names? Convention seems to be settling on UTF-8 but AFAIK it's just that.
The equivalent technique that's less risky (but of course much more verbose) is:
Where "UTF-8" is a sane default non-lossy character encoding. If you don't know the encoding that was used to write the file you're about to read, you're sort of screwed. You can try some heuristics to try to detect its encoding, or if you're "lucky" you might find a Unicode Byte Order Mark.
Note that none of this headache is particular to Java, it's just that the designers of Java knew early on that a character is not a byte and formalized that distinction (poorly at first) in the language and libraries.
I must say that is mitigated by the fact the Java has hands down the best API documentation for any platform. Really what more could you ask for. Combined with the Swingset and there SWING component guide, who could ask for anything more in terms of documentation? Mind you I'll agree that getting used to all the layers can be a burden when first learning but it becomes elegant once you see the big picture.
Your CPU is not doing anything else, at least do something.
For any of these benchmarks, does somebody have comparable statistics for a C/C++ implementation?
Obviously some of the benchmarks would be apples-and-oranges, but there should be a few of them that would allow a direct comparison...
Time flies like an arrow. Fruit flies like a banana.
For one of my classes, I've been using Eclipse to do Java development. The CS lab at school has only Windows machines (XP Pro; P4-3.2G w/ HT, I think) and Eclipse runs very nicely on these computers.
At home, I run Linux on a P4-2.6G w/ HT. Frankly, Eclipse runs like ass on Linux. I've tested it with pretty much every available JRE/J2SDK for Linux, and it sucks with all of them.
This is using Eclipse with SWT compiled for GTK+. I have used WebSphere with the Motif libraries, and it was quite fast, but Motif is just horrid to use next to GTK+. But, SWT with GTK+ is just so damned slow. I've run Eclipse on my PowerBook G4, and it sucks even more on Mac OS.
I find this funny that Windows is the best supported platform for Java GUI programs, considering that MS hates Java. So, is GUI performance with Java apps ever going to be acceptable on Linux? It's really pathetic at this point.
I know Sun added OpenGL 2D acceleration to their 1.5.0 JRE, but that gives me lots of artifacts with the included demo programs, and SWT doesn't use the acceleration at all.
1, 1, 2, 3, 5, 8, 13, 21 -- Mathematics is the Language of Nature.
Also, the lack of unsigned types in Java can sometimes be painful.
Also gcj-compiled programs may have worse garbage collection. AFAIK a simple conservative GC is used.
I don't think commonly-used Java JIT compilers do much more than this.
Wow no AMD vs Intel wars :). Hardly even see any Java vs .Net...
On a serious side, I'm curious about java benchmarks on Itanium. I've seen a tender where the specs were java on Itanium for production and java on x86 for development (d'oh).
Anyone have benchmarks comparing Java performance on Itanium vs x86? I've seen some on the SPEC website, any others?
Dave, check out http://www.sinby.com/webmaker/html/$en/Products/Ja va/KE/
for a kaffe port to eCos. It hasn't been merged in into the mainline yet, though, but help on doing that would be most appreciated.
cheers,
dalibor topic
... they didn't use that, eh?
:/) enables some extra optimizations that would take too long for a just in time compiler.
The docs say that it (can't remember the correct name
Quite a good idea, actually, most of the time you do have the source avaible, and you can probably run it off MSIL bytecode too.