Fork me on GitHub
#datascript
<
2015-08-19
>
Niki09:08:17

Somehow I missed there was a DataScript channel there simple_smile

Niki09:08:18

@jonas: sorted set a much slower to scan by

Niki09:08:41

they use binary tree (red-black), so they have to chase pointers constantly

Niki09:08:00

in btset I have arrays much like vector has

Niki09:08:13

inside array it’s very fast to iterate (chunking)

Niki09:08:24

and most of the queries are index scans

Niki09:08:30

binary lookups and index scans

Niki09:08:22

I lose at almost everything (lookups, insertion, structural sharing percentage) but win a lot on scans

Niki10:08:47

here’s a perf comparison between 0.11.4 and 0.11.5, when I upgraded JVM implementation from sorted-set to BTset

Niki10:08:04

blue and green are “how much times faster”

Niki10:08:15

reds are “how much times slower”

Niki10:08:42

you can see it’s 50-70% slower on conj/disj/lookup

Niki10:08:58

and 400-900% faster on iterate

jonas10:08:17

@tonsky: ok, so it’s for performance reasons. Have you tried to compare perf between clojure’s red-black trees and data.avl?

jonas10:08:47

Logically, representing ‘datoms’ as a sorted set of facts (with different sort orders, such as :avet :eavt etc) is the correct abstraction for implementing datalog? Or is there something missing from the ‘sorted set’ abstraction?

jonas10:08:19

@tonsky one more question (sorry to bother you). Is the benchmark code available somewhere?

Niki13:08:18

yes, I think it’s the right abstraction

Niki13:08:48

only thing missing from sorted-set is ranges

Niki13:08:04

meaninig, you can find where X is and where Y is inside a set

jonas13:08:12

which data.avl has

Niki13:08:15

but you cannot easily take an iterator from X to Y

jonas13:08:28

thanks for the link, I’ll take a look at it later tonight

sonnyto16:08:39

i'm getting this error:

sonnyto16:08:39

Uncaught #error {:message "Expected number or lookup ref for entity id, got :artwork.status/sold", :data {:error :entity-id/syntax, :entity-id :artwork.status/sold}}

sonnyto16:08:47

does datascript support enum?

Niki17:08:15

@sonnyto: are you trying to use :db/ident?

Niki17:08:21

not at the moment

Niki17:08:32

maybe I’ll add support later

Niki17:08:41

for now you can use lookup refs:

Niki17:08:08

[:db/ident <keyword>] instead of <keyword> in place where entity id is expected

sonnyto17:08:05

Yes. Thanks! Will use keyword instead.

Niki17:08:30

Yes, I found keywords to be much easier to use

sonnyto17:08:09

Oops misread. OK I'll look into it