The Java space vs time trade-off
Posted on July 23, 2007
Filed Under Programming
QT is popular application development framework used most notably in KDE where it is -the- toolkit of choice for programmers. Recently QT has added bindings for Java, Ruby, python, C#(Mono), to go along with its legacy C++ bindings. Richard Dale has performed a comparison of the bindings on the popular colliding mice QGraphicsView example. It results illustrate the typical Java space vs time trade-off
Here are the memory figures from top with the ratio to the C++ value in brackets for the bindings languages:
- C++ virtual: 15.6Mb resident: 7.3Mb shared: 9.9Mb
- QtJambi (java-6-sun-1.6) virtual: 239Mb (15x) resident: 46Mb (6.27x) shared: 20Mb (3.24x)
- QtRuby virtual: 33.2Mb (2.13x) resident: 16Mb (2.18x) shared: 9.9Mb (1.6x)
- Qyoto virtual: 45Mb (2.88x) resident: 17Mb (2.32x) shared: 12Mb (1.94x)
So QtRuby and Qyoto/Mono use about twice the memory of C++, and QtJambi uses twice as much again. Next I divided the ‘real time’ by the ‘user time’ plus ’system time’ figures, and calculated the mill consumption relative to C++:
- QtJambi (java-6-sun-1.6) 1.8 times slower
- QtRuby 4.1 times slower
- Qyoto 5.0 times slower
We haven’t done much performance tuning for the Qyoto bindings yet, and it may be possible to speed them up and beat ruby…….
……
……
I haven’t got a current version of PyQt to try the same test, but I would expect it to be pretty much as fast as QtJambi and consume about the same memory as QtRuby or Qyoto though.
Comments
One Response to “The Java space vs time trade-off”
Leave a Reply


[...] I disagree with the characterization of Java as “slow”. Most objective language comparisons and benchmarks show Java to be among the faster languages around. Certainly not a fast as C but [...]