简体   繁体   English

Clojure / Java互操作是否很慢?

[英]Is Clojure / Java interop slow?

Is calling Java from Clojure slow in comparison to pure Clojure code? 与纯Clojure代码相比,从Clojure调用Java是否较慢? And is this because there is always reflection under the hood? 这是因为引擎盖下总有反射吗? Thanks. 谢谢。

Not really. 并不是的。 You can generally write java interop code in clojure that is exactly as fast as equivalent java code, including type hints to eliminate reflection. 通常,您可以用clojure编写Java互操作代码,该代码与等效的Java代码完全一样快,包括消除反射的类型提示。 Generally that means its more low level, much more verbose and faster than idiomatic clojure. 通常,这意味着它比惯用Clojure的级别更低,更冗长且更快

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM