Fork me on GitHub
#datascript
<
2018-11-26
>
Oliver George00:11:42

Are there any rules of thumb about how many facts datascript can comfortably support before performance gets tricky. I'm thinking about suitability for use with re-frame for a webapp and re-natal mobile app.

fmjrey10:11:27

I would be curious to know too.

danielstockton11:11:55

I think you'd probably run into memory issues before datascript performance became an issue

danielstockton11:11:30

Doubt it's a concern in most typical web/mobile apps, if you would be storing everything in memory anyway

Oliver George22:11:49

I'm thinking 10k facts is likely. That'd save lots of network traffic for looks ups to essentially static data. Can't see getting to 100k facts.

Oliver George22:11:51

Newbie observation: When I put a datascript db inside by re-frame.db/app-db and use their debug interceptor I get an error. The error occurs when clojure.data/diff tries to compare the before and after db.

Clojure 1.10.0-beta8
user=> (require 'clojure.data)
nil
user=> (require 'datascript.core)
nil
(clojure.data/diff
  (datascript.core/empty-db)
  (datascript.core/db-with
    (datascript.core/empty-db)
    [{:a 1}]))
Execution error (ClassCastException) at user/eval5 (REPL:1).
datascript.db.Datom cannot be cast to java.util.Map$Entry

Oliver George22:11:50

I realise diffing the db is silly but it does seem like a bug.

Oliver George22:11:57

Is this worth logging as a bug?