Great work, Dan! I think adding a way to diff standard clojure data
structures efficiently would open up very interesting possibilities.
Two examples:
- log changes in reagent's state-atom (clojurescript)
- build a simple durable "database" atom (persistent across process
restarts) using a diff-ba
Thanks for the feedback!
Glad to hear that it might be of interest.
I did some more tests this time in clojure:
;; test diff on one small change
(def m2 (zipmap (range 1) (range 1)))
(crit/quick-bench (diff-data m2 (assoc m2 42 :a)))
Execution time mean : 243,902630 µs
On Thursday, October 13, 2016 at 12:23:21 PM UTC-5, Dan wrote:
>
> Hi
>
> I would like to be able to take advantage of the tree structures
> underneath e.g. hash-maps for a faster diff.
>
> I wrote a gist to do this in clojurescript
> https://gist.github.com/danjohansson/add5515b2067b3036044d45
Hi
I would like to be able to take advantage of the tree structures underneath
e.g. hash-maps for a faster diff.
I wrote a gist to do this in
clojurescript
https://gist.github.com/danjohansson/add5515b2067b3036044d450cbec08f3
I guess BitmapIndexedNode etc are implementation details of
Persis