3 ms·
My results with newer versions of gcc and go: gcc 4.7.2 o3 0.765s java openjdk 7 1.066s java openjdk 6 1.118s go 1.1b 1.653s rust 0.6 opt 3 1.659s g
by hamax 14y ago
My results with newer versions of gcc and go:
gcc 4.7.2 o3 0.765s
java openjdk 7 1.066s
java openjdk 6 1.118s
go 1.1b 1.653s
rust 0.6 opt 3 1.659s
go 1.0.2 2.127s
dart 0.4.4.4 2.384s
pypy PyPy 1.9.0 5.094s
pypy PyPy 2.0b 5.319s
(Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz)
Edit: Added java
- melling 14y agoIt looks like Go 1.1 might be faster than Java. That might help convince enterprise developers to adopt it.
- hamax 14y agoAdded java to the list. It's still faster then go.
- jfb 14y agoNo way would a microbenchmark ever change any responsible person's mind about tooling. There are a lot of reasons (some of them nearly respectable) to use Java; "it's faster than <X>" isn't one of them.
- saosebastiao 14y agoDon't be silly. Java is extensively used for speed. It is an extremely fast language with a few caveats (such as startup/warmup time).
- melling 14y agoOf course, I didn't mean to imply that any microbenchmark would change someone's mind. It's kind of absurd to think that's what I meant. Go should approach C/C++ in performance and often Java is promoted as about 2x slower than these two languages. Fast compilation and linking is another big plus. The formatting consistency is another. It's not a verbose language either.
- elteto 14y agoJust curious, are you factoring in the VM warmup time for Java?