[BangPypers] Tuples vs Lists, perfromance difference

Navin Kabra navin.kabra at gmail.com
Thu Dec 24 06:49:18 CET 2009


On Thu, Dec 24, 2009 at 7:39 AM, Senthil Kumaran <orsenthil at gmail.com>wrote:

> Here is the link:
> http://shootout.alioth.debian.org/
>
> There are three Java states given, Java -xint, Java steady state and Java
> -server. Try choosing each of them and compare against Python and C++.
> With respect to Python, you will find the alternative differences in
> with java -xint and java -server and while java steady state will
> always be faster ( I think, the java steady stage ignores the loading
> of the virtual machine).


Actually, steady state is more about ensuring that the JIT compiler has had
time to kick in.

I think in most cases steady state is the most useful one to compare
against. In real life, you're typically concerned about performance in long
running programs (i.e. seconds as opposed to milliseconds - otherwise why
are you bothered?) and in that case, the JVM would be in steady state for
most of the time.



> But all of them will slower when compared to
> C++.  Yeah, it is right to expect that JVM based will be slower than
> compiled C++ code. Is it not?
>

Nope. With JIT compilation, a JVM can actually beat C++

Overall, though, from the shootout page, it looks like Java is comparable to
C/C++ in many cases, and a little slower in some cases. Python, on the other
hand, is 10x to 30x slower in most cases... So my point still stands

navin.


More information about the BangPypers mailing list