Why is the Clojure Hello World program so slow compared to Java and Python?

后端 未结 4 1118
借酒劲吻你
借酒劲吻你 2021-02-20 08:49

Update

As suggested by many people, it looks like this was because of the fact that clojure code was first compiled and then executed. AOT compilation s

4条回答
  •  没有蜡笔的小新
    2021-02-20 09:16

    You're not measuring much here except for Clojure boot time. You're also running your program in such a way that you are measuring compilation time as well. If you want to see faster load times you'll need to ahead-of-time compile your code.

    Having coded a bit in Python, I've found that Clojure is as a general rule much, much, much faster than Python and you can usually get a Clojure program to get within 2X-4X of the speed of pure Java.

提交回复
热议问题