From 0a45b45e683009903781942388ba349481e13267 Mon Sep 17 00:00:00 2001 From: Nathan Marz Date: Thu, 1 Sep 2016 23:41:27 -0400 Subject: [PATCH] added specter dynamic nested get benchmark --- scripts/benchmarks.clj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/benchmarks.clj b/scripts/benchmarks.clj index ebc4ad7..244aa5c 100644 --- a/scripts/benchmarks.clj +++ b/scripts/benchmarks.clj @@ -56,6 +56,9 @@ (println "\n********************************\n")))) +(defn specter-dynamic-nested-get [data a b c] + (select-any [(keypath a) (keypath b) (keypath c)] data)) + (let [data {:a {:b {:c 1}}} p (comp-paths :a :b :c)] (run-benchmark "get value in nested map" 2500000 @@ -64,6 +67,7 @@ (select-first [:a :b :c] data) (select-one! [:a :b :c] data) (compiled-select-any p data) + (specter-dynamic-nested-get data :a :b :c) (get-in data [:a :b :c]) (-> data :a :b :c) (select-any [(keypath :a) (keypath :b) (keypath :c)] data)))