O'Reilly logo

Clojure High Performance Programming by Shantanu Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Leaning on Java

Being hosted on the Java Virtual Machine (JVM), there are several aspects of Clojure in which it really helps to know about the Java language and platform. The need is not only due to interoperability with Java or understanding its implementation, but also for performance reasons. In certain cases, Clojure may not generate optimized JVM bytecode by default; in some other cases, you may want to go beyond the performance Clojure data structures offer — you can use the Java alternatives via Clojure to get better performance. This chapter discusses those aspects of Clojure. In this chapter, we will discuss:

  • Inspecting Java generated from Clojure source
  • Numerics and primitives
  • Working with arrays
  • Reflection and type hinting

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required