A performance comparison of Clojure and Java

University essay from KTH/Skolan för elektroteknik och datavetenskap (EECS)

Author: Gustav Krantz; [2020]

Keywords: ;

Abstract: Clojure is a relatively new functional programming language that can compile to both Java bytecode and JavaScript (ClojureScript), with features like persistent data structures and a high level of abstraction. With new languages it is important to not only look at their features, but also evaluate how well they perform in practice. Using methods proposed by Georges, Buytaert, and Eeckhout [1], this study attempts to give the reader an idea of what kind of performance a programmer can expect when they choose to program in Clojure. This is done by first comparing the steady-state runtime of Clojure with that of Java in several small example programs, and then comparing the startup time of Clojure with that of Java using the same example programs. It was found that Clojure ran several times slower than Java in all conducted experiments. The steady-state experiments showed that the slowdown factors ranged between 2.4826 and 28.8577. The startup slowdown factors observed ranged between 2.4872 and 52.0417. These results strongly suggest that the use of Clojure over Java comes with a cost of both startup and runtime performance.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)