Fork me on GitHub
#datascript
<
2018-10-16
>
isak15:10:36

anyone had any luck with quickly serializing/deserializing datascript dbs with lots of datoms?

petterik19:10:55

@isak What have you tried? Have you seen datascript-transit? https://github.com/tonsky/datascript-transit

petterik19:10:18

Or do you need to incremental updates to the serialization/deserialization?

isak19:10:02

@petterik I've tried that one (datascript-transit - seems to optimize for size rather than speed), fressian, and just got nippy to work with it. But not happy with the performance yet - takes several seconds to serialize just 30 mb of data. Curious if other people have looked into this and found something they are happy with.

Braden Shepherdson19:10:37

running in which environment, for reference?

isak19:10:47

clojure on windows

isak19:10:29

What I did is to serialize everything, not just :eavt datoms, because I think it is too slow to have to sort many times when loading the data

Braden Shepherdson20:10:42

how does datascript store the indices? are they sorted arrays or some other structure? it seems like a bulk-loading API would be useful.

isak20:10:06

It just uses this structure: https://github.com/tonsky/datascript/blob/master/src/datascript/btset.cljc#L5-L17 The constructors for these are public, so I just used those