Skip to main content

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

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 7628))

Abstract

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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 

  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)

    Article  MathSciNet  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 

  15. Prechelt, L., et al.: Comparing Java vs. C/C++ efficiency differences to interpersonal differences. Communications of the ACM 42(10), 109–112 (1999)

    Article  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

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Gherardi, L., Brugali, D., Comotti, D. (2012). A Java vs. C++ Performance Evaluation: A 3D Modeling Benchmark. In: Noda, I., Ando, N., Brugali, D., Kuffner, J.J. (eds) Simulation, Modeling, and Programming for Autonomous Robots. SIMPAR 2012. Lecture Notes in Computer Science(), vol 7628. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34327-8_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-34327-8_17

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-34326-1

  • Online ISBN: 978-3-642-34327-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics