This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-06
Channels
- # aleph (43)
- # announcements (11)
- # babashka (35)
- # beginners (70)
- # calva (4)
- # cider (8)
- # clerk (15)
- # clojure (192)
- # clojure-dev (7)
- # clojure-europe (44)
- # clojure-nl (2)
- # clojure-norway (65)
- # clojure-uk (4)
- # code-reviews (4)
- # conjure (1)
- # cursive (41)
- # data-science (1)
- # datomic (8)
- # emacs (7)
- # fulcro (13)
- # humbleui (17)
- # hyperfiddle (53)
- # kaocha (4)
- # malli (7)
- # missionary (17)
- # music (1)
- # obb (1)
- # off-topic (8)
- # polylith (1)
- # portal (3)
- # releases (11)
- # shadow-cljs (36)
- # squint (4)
- # tools-deps (4)
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?