A Java vs. C++ Performance Evaluation: A 3D Modeling Benchmark
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.
Unable to display preview. Download preview PDF.
- 1.Just in time compiler, http://en.wikipedia.org/wiki/JIT_compiler
- 2.Open Scene Graph, http://www.openscenegraph.org
- 3.Open Scene Graph API reference, http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs
- 4.Rosjava - An implementation of ROS in pure Java with Android support, http://code.google.com/p/rosjava/
- 5.Specifications of java.util.collections, http://docs.oracle.com/javase/6/docs/api/java/util/Collections.html
- 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.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.Delaunay, B.: Sur la sphere vide. Izv. Akad. Nauk SSSR, Otdelenie Matematicheskii i Estestvennyka Nauk 7, 793–800 (1934)Google Scholar
- 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.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.Mangione, C.: Performance tests show java as fast as c++. JavaWorld (1998)Google Scholar
- 13.Meloan, S.: The Java HotSpot (tm) Perfomance Engine: An In-Depth Look. Article on Suns Java Developer Connection site (1999)Google Scholar
- 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
- 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.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.Roulo, M.: Accelerate your Java apps. Java World (1998)Google Scholar
- 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.Wilson, S., Kesselman, J.: JavaTM Platform Performance - ch. 8. Sun Microsystems (2001), http://java.sun.com/docs/books/performance/1st_edition/html/JPAlgorithms.fm.html