Liking cljdoc? Tell your friends :D

update-in* performance

update-in* version 5 offers notable performance improvements for nested hashmaps and nested vectors.

See the overall summary for benchmarking details. The benchmarks displayed in this document are defined here.

Hashmaps

Version 5 improves performance to within 18% of clojure.core/update-in when handling hashmaps.

(fn [n] (update-in (nested-map n) (path-map n) inc))

Benchmark measurements for expression `(fn [n] (update-in (nested-map n) (path-map n) inc))`, time versus 'n' arguments, comparing different versions. Show details

(fn [n] (update-in* (nested-map n) (path-map n) inc))

Benchmark measurements for expression `(fn [n] (update-in* (nested-map n) (path-map n) inc))`, time versus 'n' arguments, comparing different versions. Show details

Lists

Version 5 improves performance 5 to 15% when handling lists.

(fn [n] (update-in* (nested-list n) (path-list n) inc))

Benchmark measurements for expression `(fn [n] (update-in* (nested-list n) (path-list n) inc))`, time versus 'n' arguments, comparing different versions. Show details

Sequences

Version 5 provides slightly improved performance when handling nested lists.

(fn [n] (update-in* (nested-seq n) (path-seq n) inc))

Benchmark measurements for expression `(fn [n] (update-in* (nested-seq n) (path-seq n) inc))`, time versus 'n' arguments, comparing different versions. Show details

Vectors

Version 5 performs about twice as fast as version 4 on nested vectors.

(fn [n] (update-in (narrow-deep-vec n) (path-narrow-deep-vec n) inc))

Benchmark measurements for expression `(fn [n] (update-in (narrow-deep-vec n) (path-narrow-deep-vec n) inc))`, time versus 'n' arguments, comparing different versions. Show details

(fn [n] (update-in (nested-vec n) (path-nested-vec n) inc))

Benchmark measurements for expression `(fn [n] (update-in (nested-vec n) (path-nested-vec n) inc))`, time versus 'n' arguments, comparing different versions. Show details

(fn [n] (update-in* (narrow-deep-vec n) (path-narrow-deep-vec n) inc))

Benchmark measurements for expression `(fn [n] (update-in* (narrow-deep-vec n) (path-narrow-deep-vec n) inc))`, time versus 'n' arguments, comparing different versions. Show details

(fn [n] (update-in* (nested-vec n) (path-nested-vec n) inc))

Benchmark measurements for expression `(fn [n] (update-in* (nested-vec n) (path-nested-vec n) inc))`, 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