Liking cljdoc? Tell your friends :D

update* performance

Aside from lists, update* version 5 is about 50% faster than version 4.

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

Hashmaps

update* version 5 performance improved to within 8% that of clojure.core/update.

(fn [n] (update (map-of-n-key-vals n) (dec n) inc))

Benchmark measurements for expression `(fn [n] (update (map-of-n-key-vals n) (dec n) inc))`, time versus 'n' arguments, comparing different versions. Show details

(fn [n] (update* (map-of-n-key-vals n) (dec n) inc))

Benchmark measurements for expression `(fn [n] (update* (map-of-n-key-vals n) (dec n) inc))`, time versus 'n' arguments, comparing different versions. Show details

Lists

Performance on lists did not perceptibly change between versions.

(fn [n] (update* (list-of-n-rand-ints n) (dec n) inc))

Benchmark measurements for expression `(fn [n] (update* (list-of-n-rand-ints n) (dec n) inc))`, time versus 'n' arguments, comparing different versions. Show details

Sequences

update* version 5 performance handling sequences improved by a factor of two.

(fn [n] (update (seq-of-n-rand-ints n) (dec n) inc))

Benchmark measurements for expression `(fn [n] (update (seq-of-n-rand-ints n) (dec n) inc))`, time versus 'n' arguments, comparing different versions. Show details

(fn [n] (update* (seq-of-n-rand-ints n) (dec n) inc))

Benchmark measurements for expression `(fn [n] (update* (seq-of-n-rand-ints n) (dec n) inc))`, time versus 'n' arguments, comparing different versions. Show details

Vectors

Version 5 performance improved by about 50%.

(fn [n] (update (vec-of-n-rand-ints n) (dec n) inc))

Benchmark measurements for expression `(fn [n] (update (vec-of-n-rand-ints n) (dec n) inc))`, time versus 'n' arguments, comparing different versions. Show details

(fn [n] (update* (vec-of-n-rand-ints n) (dec n) inc))

Benchmark measurements for expression `(fn [n] (update* (vec-of-n-rand-ints n) (dec 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