This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-25
Channels
- # announcements (4)
- # babashka (13)
- # beginners (115)
- # cider (62)
- # clj-kondo (16)
- # cljdoc (4)
- # cljs-dev (5)
- # clojure (44)
- # clojure-europe (57)
- # clojure-greece (1)
- # clojure-italy (2)
- # clojure-nl (3)
- # clojure-spec (2)
- # clojure-uk (24)
- # clojurescript (58)
- # code-reviews (2)
- # community-development (6)
- # conjure (3)
- # core-async (9)
- # cursive (34)
- # datahike (3)
- # datalog (1)
- # datomic (67)
- # emacs (9)
- # events (5)
- # fulcro (9)
- # graalvm (1)
- # jobs (1)
- # lsp (24)
- # off-topic (20)
- # pathom (17)
- # polylith (11)
- # re-frame (21)
- # react (21)
- # reagent (3)
- # reitit (23)
- # releases (1)
- # remote-jobs (1)
- # ring (3)
- # sci (47)
- # tools-deps (7)
- # vim (15)
- # xtdb (4)
I'm kind of surprised that (crux/await-tx node "some garbage")
doesn't throw and spits out what appears to be the latest indexed tx. Is this semantically the same as crux/last-submitted-tx
? (crux/await-tx node nil)
seems to run a lot faster, 4us vs 67us
It seems to be due to a lack of validation for the type of that second parameter, where Crux is expecting a map. When you pass in a string it doesn't throw, because get
seems to be happy accepting a string (get "asdf" :a) => nil
and the nil
is comparable
See the definition of tx-v
: https://github.com/juxt/crux/blob/6df9f72fcba23d2fa966d67a5105c63496c0d492/crux-core/src/crux/node.clj#L36-L40
I think this should be semantically the same as crux/latest-completed-tx
though and I wouldn't expect there to be any performance difference there. By contrast crux/latest-submitted-tx
calls through to the tx-log, which is typically a more expensive operation
In any case, I've made a note on the project board that we could potentially benefit from the extra validation, thanks for reporting it 🙂