This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-02
Channels
- # announcements (31)
- # babashka (19)
- # beginners (90)
- # biff (1)
- # calva (172)
- # cider (3)
- # cljsrn (3)
- # clojure (84)
- # clojure-australia (1)
- # clojure-europe (11)
- # clojurescript (48)
- # css (1)
- # data-science (9)
- # datalog (3)
- # emacs (16)
- # events (2)
- # fulcro (8)
- # jackdaw (31)
- # luminus (3)
- # malli (3)
- # off-topic (13)
- # onyx (3)
- # random (1)
- # remote-jobs (2)
- # shadow-cljs (88)
- # vim (1)
- # xtdb (13)
from today doxa
can be even faster than datascript
https://github.com/ribelo/doxa#can-we-be-faster-than-datascript-yes
You posted a link to the same library 2 weeks ago. https://clojurians.slack.com/archives/C06MAR553/p1618679544447900
Is this a library meant for public consumption or more like a series of explorations? I found the API quite hard to understand from the Readme, and none of the public functions have docstrings - just some feedback 🙂
The source definitely reads more like an exploratory notebook and it seems that the dependencies on encore, timbre, shadow-cljs are only used in comment
forms and should be put into some sort of :dev
alias.
@UCPS050BV doxa was born by accident while testing what a meander can do
I will probably write docstrings once I have worked out more or less in my head how it should look and be used.
I feel like the commit
function would look better taking variable arity of transactions, except there's an optional tx-meta
argument which I couldn't figure out what it was for
(def conn_ (atom (dx/create-dx)))
(listen! @conn_
(fn [db]
(let [tx-meta ((meta db) :tx-meta)]
(cond
(#{:one :two} tx-meta)
(println :something)
(#{:three} tx-meta)
(println :something-else)))))
(dx/commit! conn_ [:dx/put {:db/id 0 :key :value}] :one)
(dx/commit! conn_ [:dx/put {:db/id 1 :key :value}] :two)
(dx/commit! conn_ [:dx/put {:db/id 2 :key :value}] :three)
;; => repl
;; :something
;; :something
;; :something-else
I like this lib and will definitely use it if it reaches prod quality. thanks for making it
I am a little sceptical that a hash index {eid {k v}} could possibly beat indexed datascript in the general case? e.g not trivially small databases, and not 'get large portion of all the rows' type queries. @U0BBFDED7 any magic I am missing? Aren't value queries going to have to scan the the whole 'table'?
nested map can be faster due to the possibility of limiting the iterated elements, @U0GE2S1NH
[(datascript-query) (dx-query) (fast-dx-query)]
;; clj => [182.98 685.15 71.05] - in ms
for a normal query doxa is ~5x slowerBy the way, initially the goal was not to race with datascript
at all, rather easy interop with re-frame
and seamless data synchronisation with firestore
using the re-frame app-db is why I like this lib. using datalog instead of specter for subs is a nice architecture. it does mean losing some perf because equals? can’t use identical? but that’s ok for 80% of my use cases
@U0BBFDED7 do you want issues logged yet? I have a couple of feature requests: 1. runtime query & 2. query/pull without ?table. just checking when you think bugs/feature requests are useful
you can see it here https://countries.trevorblades.com/