diff --git a/CHANGES.md b/CHANGES.md index 9f63c77..0f3e790 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ * Add `satisfies-protpath?` * Inline cache vars are marked private so as not to interfere with tooling -* Improve performance of ALL transform on lists by 7x +* Improve performance of `ALL` transform on lists by 20% * Bug fix: Using `pred` no longer inserts unecessary `coerce-nav` call at callsite * Bug fix: Dynamic navs in argument position to another nav now properly expanded and compiled * Bug fix: Dynamic parameters nested inside data structures as arguments are now compiled correctly by inline compiler diff --git a/scripts/benchmarks.clj b/scripts/benchmarks.clj index 9cf16d2..bf3fba7 100644 --- a/scripts/benchmarks.clj +++ b/scripts/benchmarks.clj @@ -55,7 +55,7 @@ (println "\n********************************\n")))) (defn specter-dynamic-nested-get [data a b c] - (select-any [(keypath a) (keypath b) (keypath c)] data)) + (select-any (keypath a b c) data)) (defn get-k [k] (fn [m next] (next (get m k)))) @@ -138,7 +138,7 @@ (let [data '(1 2 3 4 5)] (run-benchmark "transform values of a list" 500000 (transform ALL inc data) - (sequence (map inc) data) + (doall (sequence (map inc) data)) (reverse (into '() (map inc) data)) )) diff --git a/src/clj/com/rpl/specter/navs.cljc b/src/clj/com/rpl/specter/navs.cljc index 30d3837..8c1e6d5 100644 --- a/src/clj/com/rpl/specter/navs.cljc +++ b/src/clj/com/rpl/specter/navs.cljc @@ -55,7 +55,7 @@ (defn- all-transform-list [structure next-fn] - (sequence (comp (map next-fn) (filter not-NONE?)) structure)) + (doall (sequence (comp (map next-fn) (filter not-NONE?)) structure))) (extend-protocol AllTransformProtocol nil