Liking cljdoc? Tell your friends :D

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. 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. 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. 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. 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. 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. 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. 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. Show details

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close