This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-11
Channels
- # architecture (3)
- # beginners (41)
- # boot (7)
- # cider (16)
- # cljs-dev (8)
- # cljsrn (2)
- # clojure (214)
- # clojure-austin (4)
- # clojure-russia (52)
- # clojure-spec (8)
- # clojure-taiwan (1)
- # clojure-uk (10)
- # clojurescript (87)
- # cursive (14)
- # datascript (34)
- # datomic (11)
- # dirac (55)
- # emacs (12)
- # hoplon (44)
- # luminus (6)
- # lumo (24)
- # off-topic (1)
- # om (8)
- # onyx (7)
- # overtone (2)
- # pedestal (1)
- # protorepl (4)
- # re-frame (7)
- # reagent (1)
- # ring (4)
- # rum (2)
- # slack-help (1)
- # spacemacs (2)
- # specter (32)
- # unrepl (131)
- # untangled (14)
- # yada (3)
(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
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)
I don't get it: http://knowyourmeme.com/memes/kappa
even for things like 10kvs, since js is gc-ed, I'm not sure how I would measure memory usage
in fact, I think benchmarking datascript vs hashmap would be quite non-trivial since we have to taken into account browser, gc, hotspot, jit
(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
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
maybe this is a bad idea, but I'm very seriously conidefing replacing many {}'s with datascripts
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
because I often use hashmaps to encode "objects"; and if I'm doing that, datascript's query + transact would be better
I doubt benchmarking single 10datom db vs 10 kvs would give you any useful info for the 10k tiny dbs
yeah, I should have rephrased the question as: 10,000 small datascript dbs vs 10,000 small hashmaps
(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 proI don't know, but that would give me enough info to re-consider replacing every {} with a tiny db