optimize if-path and selected? for non basic fn case
This commit is contained in:
parent
f3bf935509
commit
68ac32ef56
2 changed files with 3 additions and 4 deletions
|
|
@ -52,7 +52,6 @@
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(let [data {:a {:b {:c 1}}}
|
(let [data {:a {:b {:c 1}}}
|
||||||
p (comp-paths :a :b :c)]
|
p (comp-paths :a :b :c)]
|
||||||
(run-benchmark "get value in nested map" 10000000
|
(run-benchmark "get value in nested map" 10000000
|
||||||
|
|
@ -92,7 +91,7 @@
|
||||||
(run-benchmark "filter a sequence" 1000000
|
(run-benchmark "filter a sequence" 1000000
|
||||||
(doall (filter even? data))
|
(doall (filter even? data))
|
||||||
(select [ALL even?] data)
|
(select [ALL even?] data)
|
||||||
(select-first (filterer even?) data)
|
(select-any (filterer even?) data)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -668,8 +668,8 @@
|
||||||
(defn not-selected?*
|
(defn not-selected?*
|
||||||
[compiled-path structure]
|
[compiled-path structure]
|
||||||
(->> structure
|
(->> structure
|
||||||
(compiled-select* compiled-path)
|
(compiled-select-any* compiled-path)
|
||||||
empty?))
|
(kw-identical? NONE)))
|
||||||
|
|
||||||
(defn selected?*
|
(defn selected?*
|
||||||
[compiled-path structure]
|
[compiled-path structure]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue