It is a know issue that inst? (that uses satisfies? ) can be more than 2000x slower than a simple predicate?
(doseq [f [inst? string? any?]]
(prn f)
(dotimes [_ 3]
(time (dotimes [_ 1e5]
(f [])))))
;; inst?: ~2000 msecs
;; string? ~0.5 msecs
;; any? ~0.5 msecs
It is slow for some values like :x, and even slower for other values like []It is a known issue that satisfies? can be slow
Particularly on non satisfying values
Do you have a ticket for that? It can be a closed one, I just want some reference to this issue
https://ask.clojure.org/index.php/3304/make-satisfies-as-fast-as-a-protocol-method-call
(has the jira ticket linked)
Is there a workaround for re-implementing inst? in an efficient way?