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

后端 未结 4 1183
借酒劲吻你
借酒劲吻你 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:15

    Also, note that the '-server' option in your clj script will use the 'server JVM' which is optimized for long-running processes at the cost of slower start up time.

    Your java example didn't include this option, so it is probably using the 'client JVM', which is optimised for faster startup time.

    Try running java -jar clojure.jar -i hellofun.clj for a fairer comparison.

提交回复
热议问题