mirror of
https://github.com/metosin/reitit.git
synced 2025-12-21 18:11:12 +00:00
fix perf tests
This commit is contained in:
parent
3aae55bd8c
commit
a9c33de7d1
1 changed files with 9 additions and 8 deletions
|
|
@ -70,11 +70,12 @@
|
|||
nil routes))
|
||||
|
||||
(def trie-matcher
|
||||
(trie/compile
|
||||
(reduce
|
||||
(fn [acc [p d]]
|
||||
(trie/insert acc p d))
|
||||
nil routes)))
|
||||
(trie/matcher
|
||||
(trie/compile
|
||||
(reduce
|
||||
(fn [acc [p d]]
|
||||
(trie/insert acc p d))
|
||||
nil routes))))
|
||||
|
||||
(defn bench! []
|
||||
|
||||
|
|
@ -108,13 +109,13 @@
|
|||
;; 0.51µs (Cleanup)
|
||||
;; 0.30µs (Java)
|
||||
#_(cc/quick-bench
|
||||
(segment/lookup segment-matcher "/v1/orgs/1/topics"))
|
||||
(segment/lookup segment-matcher "/v1/orgs/1/topics"))
|
||||
|
||||
;; 0.32µs (initial)
|
||||
;; 0.30µs (iterate arrays)
|
||||
;; 0.28µs (list-params)
|
||||
(cc/quick-bench
|
||||
(trie/matcher trie-matcher "/v1/orgs/1/topics")))
|
||||
(trie-matcher "/v1/orgs/1/topics")))
|
||||
|
||||
(comment
|
||||
(bench!))
|
||||
|
|
@ -123,6 +124,6 @@
|
|||
|
||||
(comment
|
||||
(p/lookup pedestal-tree "/v1/orgs/1/topics")
|
||||
(trie/matcher trie-matcher "/v1/orgs/1/topics")
|
||||
(trie-matcher "/v1/orgs/1/topics")
|
||||
#_(segment/lookup segment-matcher "/v1/orgs/1/topics"))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue