assoc-in* performance

Hashmaps
Lists
Sequences
Vectors

`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.

(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.

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.

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.

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.

(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.

(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.

(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.