A Java vs. C++ Performance Evaluation: A 3D Modeling Benchmark

  • Luca Gherardi
  • Davide Brugali
  • Daniele Comotti
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7628)


Along the years robotics software and applications have been typically implemented in compiled languages, such as C and C++, rather than interpreted languages, like Java. This choice has been due to their well-known faster behaviors, which meet the high performance requirements of robotics. Nevertheless, several projects that implement robotics functionality in Java can be found in literature and different experiments conduced by computer scientists have proved that the difference between Java and C++ is not so evident.

In this paper we report our work on quantifying the difference of performance between Java and C++ and we offer a set of data in order to better understand whether the performance of Java allows to consider it a valid alternative for robotics applications or not. We report about the execution time of a Java implementation of an algorithm originally written in C++ and we compare this data with the performance of the original version. Results show that, using the appropriate optimizations, Java is from 1.09 to 1.51 times slower than C++ under Windows and from 1.21 to 1.91 times under Linux.


Execution Time Point Cloud Delaunay Triangulation Average Execution Time Java Virtual Machine 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
  2. 2.
  3. 3.
  4. 4.
    Rosjava - An implementation of ROS in pure Java with Android support,
  5. 5.
  6. 6.
    Bernardin, L., Char, B., Kaltofen, E.: Symbolic computation in Java: an appraisement. In: Proceedings of the 1999 Int. Symposium on Symbolic and Algebraic Computation, pp. 237–244. ACM (1999)Google Scholar
  7. 7.
    Bull, J., Smith, L., Westhead, M., Henty, D., Davey, R.: A methodology for benchmarking Java Grande applications. In: Proceedings of the ACM 1999 Conference on Java Grande, pp. 81–88. ACM (1999)Google Scholar
  8. 8.
    Delaunay, B.: Sur la sphere vide. Izv. Akad. Nauk SSSR, Otdelenie Matematicheskii i Estestvennyka Nauk 7, 793–800 (1934)Google Scholar
  9. 9.
    Elnagar, A., Lulu, L.: A global path planning Java-based system for autonomous mobile robots. Science of Computer Programming 53(1), 107–122 (2004)MathSciNetCrossRefGoogle Scholar
  10. 10.
    Lewis, J., Neumann, U.: Performance of Java versus C++. Computer Graphics and Immersive Technology Lab, University of Southern California (January 2003)Google Scholar
  11. 11.
    Long, M., Gage, A., Murphy, R., Valavanis, K.: Application of the distributed field robot architecture to a simulated demining task. In: Proceedings of the 2005 IEEE Int. Conference on Robotics and Automation, ICRA 2005. IEEE (2005)Google Scholar
  12. 12.
    Mangione, C.: Performance tests show java as fast as c++. JavaWorld (1998)Google Scholar
  13. 13.
    Meloan, S.: The Java HotSpot (tm) Perfomance Engine: An In-Depth Look. Article on Suns Java Developer Connection site (1999)Google Scholar
  14. 14.
    Monteiro, F., Rocha, P., Menezes, P., Silva, A., Dias, J.: Teleoperating a mobile robot. A solution based on JAVA language. In: Proceedings of the IEEE Int. Symposium on Industrial Electronics, ISIE 1997, vol. 1. IEEE (2002)Google Scholar
  15. 15.
    Prechelt, L., et al.: Comparing Java vs. C/C++ efficiency differences to interpersonal differences. Communications of the ACM 42(10), 109–112 (1999)CrossRefGoogle Scholar
  16. 16.
    Raimondi, F., Ciancimino, L., Melluso, M.: Real-time remote control of a robot manipulator using java and client-server architecture. In: Proceedings of the 7th Int. Conference on Automatic Control, Modeling and Simulation (2005)Google Scholar
  17. 17.
    Robertz, S., Henriksson, R., Nilsson, K., Blomdell, A., Tarasov, I.: Using real-time Java for industrial robot control. In: Proceedings of the 5th Int. Workshop on Java Technologies for Real-Time and Embedded Systems, pp. 104–110. ACM (2007)Google Scholar
  18. 18.
    Roulo, M.: Accelerate your Java apps. Java World (1998)Google Scholar
  19. 19.
    Spw, S., Wentworth, S., Langan, D.: Performance evaluation: Java vs. c++. In: 39th Annual ACM Southeast Regional Conference, March 16-17. Citeseer (2001)Google Scholar
  20. 20.
    Wilson, S., Kesselman, J.: JavaTM Platform Performance - ch. 8. Sun Microsystems (2001),

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Luca Gherardi
    • 1
  • Davide Brugali
    • 1
  • Daniele Comotti
    • 1
  1. 1.DIIMMUniversity of BergamoItaly

Personalised recommendations