Fork me on GitHub
#datascript
<
2017-03-11
>
misha00:03:19

(count dump/transit-string)
=> 2806139
(count @conn)
=> 35026

$ gzip -9 ~/Desktop/ds.edn
$ ls -la ~/Desktop/ | grep ds.
... 2966238 Mar 11 02:58 ds.edn
... 1188981 Mar 11 02:56 ds.edn.gz

misha01:03:05

@mruzekw or do you mean dependency? opieop

qqq02:03:25

is there a benchmark showing overhead of datascript vs hashmap for: * create empty * assoc/update single item * read * small data (i.e. <= 10 kv pairs)

misha03:03:57

for 10kvs just do it yourself kappa

qqq03:03:39

@misha: what does "kappa" mean? I tried google, but I don't get the reference.

misha03:03:58

emotion displayed on that dude's face

qqq03:03:40

if it's intended to convey sarcasm, I don't get the sarcasm in your statement

qqq03:03:59

even for things like 10kvs, since js is gc-ed, I'm not sure how I would measure memory usage

qqq03:03:27

in fact, I think benchmarking datascript vs hashmap would be quite non-trivial since we have to taken into account browser, gc, hotspot, jit

qqq03:03:48

(1) because of gc, it's not clear to me how to measure memory usage; an d(2) because of hotspot/jitting, I feel like any timing would be too noisy

misha03:03:10

I don't think any of those matter for 10 datoms/kvs, unless it is embedded device, in which case you would not even consider using datascript in the first place

qqq03:03:34

maybe this is a bad idea, but I'm very seriously conidefing replacing many {}'s with datascripts

qqq03:03:55

so it's not just a single datascript with 10 datoms/kvs (though I did not explain this well) -- but lots of places, where I previously used hashmap, I'd now use datascript

qqq03:03:20

because I often use hashmaps to encode "objects"; and if I'm doing that, datascript's query + transact would be better

qqq03:03:38

so I guess I should have rephrased my qeustions as follows:

qqq03:03:49

what's the performance of using 10,000 small datascripts vs 10,000 small hashmaps

qqq03:03:00

that's the question I should have asked in retrospect

misha03:03:03

single db instead of lots of maps? or lots of dbs instead of lots of maps?

qqq03:03:13

lots of dbs instead of lots of maps

qqq03:03:19

I'm curious how "lightweight" datascript is

misha03:03:33

I doubt benchmarking single 10datom db vs 10 kvs would give you any useful info for the 10k tiny dbs

qqq03:03:11

yeah, I should have rephrased the question as: 10,000 small datascript dbs vs 10,000 small hashmaps

misha03:03:29

(time
  (dotimes [_ 10000]
     (hash-map [:foo :bar])))   
"Elapsed time: 6.585000 msecs"

(time
  (dotimes [_ 10000]
     (ds/transact! (ds/create-conn) [{:foo :bar}])))   
"Elapsed time: 1248.580000 msecs"
how about this benchmark? cljs in chrome on quadcore i7 macbook pro

qqq03:03:45

(1) you win

qqq03:03:00

(2) it's 200 times slower?

misha03:03:33

I don't know, but that would give me enough info to re-consider replacing every {} with a tiny db

qqq03:03:04

it's enough into to decide against

misha03:03:11

this is what I meant by "for 10kvs just do it yourself"

Aron06:03:27

these micro benchmarks are the worst

Aron06:03:53

you gain no knowledge through them, they more often just mislead you

rauh07:03:11

@mruzekw When I first added datascript it added ~30kb gzipped to the project. 15kb gzipped if you don't need the query engine (which I don't use and stripped).