1

Is calling Java from Clojure slow in comparison to pure Clojure code? And is this because there is always reflection under the hood? Thanks.

2
  • 1
    No, and no. (Correctly done interop calls are not slow, and there is not always reflection under the hood). Commented Sep 14, 2014 at 23:00
  • Keep in mind that as Java is Clojure's runtime, if all calls into Java involved reflection, absolutely anything/everything Clojure did would be slow, because everything is Java at the bottom. Calls into clojure.lang.RT are typically done through the same mechanisms as anything else. Commented Sep 14, 2014 at 23:02

1 Answer 1

2

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. Generally that means its more low level, much more verbose and faster than idiomatic clojure.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.