assoc-in* performance
`assoc-in` preamble
See the overall summary for benchmarking details. The benchmarks displayed in
this document are defined here.
Hashmaps
assoc-in*
version 5 improves the performance on hashmaps to near parity with clojure.core/assoc-in
.
(fn [n] (assoc-in (nested-map n) (path-map n) :benchmark-sentinel))
![Benchmark measurements for expression `(fn [n] (assoc-in (nested-map n) (path-map n) :benchmark-sentinel))`, time versus 'n' arguments, comparing different versions.](https://github.com/blosavio/fn-in/raw/v5/doc/img_assoc_in/group-0-fexpr-0.svg?sanitize=true)
Show details
(fn [n] (assoc-in* (nested-map n) (path-map n) :benchmark-sentinel))
![Benchmark measurements for expression `(fn [n] (assoc-in* (nested-map n) (path-map n) :benchmark-sentinel))`, time versus 'n' arguments, comparing different versions.](https://github.com/blosavio/fn-in/raw/v5/doc/img_assoc_in/group-0-fexpr-1.svg?sanitize=true)
Show details
Lists
Version 5 offers a bit of improved performance for nested lists.
(fn [n] (assoc-in* (nested-list n) (path-list n) :benchmark-sentinel))
![Benchmark measurements for expression `(fn [n] (assoc-in* (nested-list n) (path-list n) :benchmark-sentinel))`, time versus 'n' arguments, comparing different versions.](https://github.com/blosavio/fn-in/raw/v5/doc/img_assoc_in/group-1-fexpr-0.svg?sanitize=true)
Show details
Sequences
Version 5 offers a bit of improved performance for nested sequences.
(fn [n] (assoc-in* (nested-seq n) (path-seq n) :benchmark-sentinel))
![Benchmark measurements for expression `(fn [n] (assoc-in* (nested-seq n) (path-seq n) :benchmark-sentinel))`, time versus 'n' arguments, comparing different versions.](https://github.com/blosavio/fn-in/raw/v5/doc/img_assoc_in/group-2-fexpr-0.svg?sanitize=true)
Show details
Vectors
The top two panels display strange behavior, suggesting that clojure.core/get
changed performance. Discounting that spurious change,
compared to itself, assoc-in*
version 5 performed 33 to 67% faster than version 4.
(fn [n] (assoc-in (narrow-deep-vec n) (path-narrow-deep-vec n) :benchmark-sentinel))
![Benchmark measurements for expression `(fn [n] (assoc-in (narrow-deep-vec n) (path-narrow-deep-vec n) :benchmark-sentinel))`, time versus 'n' arguments, comparing different versions.](https://github.com/blosavio/fn-in/raw/v5/doc/img_assoc_in/group-3-fexpr-0.svg?sanitize=true)
Show details
(fn [n] (assoc-in (nested-vec n) (path-nested-vec n) :benchmark-sentinel))
![Benchmark measurements for expression `(fn [n] (assoc-in (nested-vec n) (path-nested-vec n) :benchmark-sentinel))`, time versus 'n' arguments, comparing different versions.](https://github.com/blosavio/fn-in/raw/v5/doc/img_assoc_in/group-3-fexpr-1.svg?sanitize=true)
Show details
(fn [n] (assoc-in* (narrow-deep-vec n) (path-narrow-deep-vec n) :benchmark-sentinel))
![Benchmark measurements for expression `(fn [n] (assoc-in* (narrow-deep-vec n) (path-narrow-deep-vec n) :benchmark-sentinel))`, time versus 'n' arguments, comparing different versions.](https://github.com/blosavio/fn-in/raw/v5/doc/img_assoc_in/group-3-fexpr-2.svg?sanitize=true)
Show details
(fn [n] (assoc-in* (nested-vec n) (path-nested-vec n) :benchmark-sentinel))
![Benchmark measurements for expression `(fn [n] (assoc-in* (nested-vec n) (path-nested-vec n) :benchmark-sentinel))`, time versus 'n' arguments, comparing different versions.](https://github.com/blosavio/fn-in/raw/v5/doc/img_assoc_in/group-3-fexpr-3.svg?sanitize=true)
Show details