mirror of
https://github.com/metosin/reitit.git
synced 2025-12-23 18:41:11 +00:00
Cleanup & fix perf test
This commit is contained in:
parent
1835ffc681
commit
5f1d6a61a6
4 changed files with 4 additions and 5 deletions
|
|
@ -93,7 +93,7 @@
|
||||||
|
|
||||||
;; 2.4µs (-84%)
|
;; 2.4µs (-84%)
|
||||||
(title "pedestal - map-tree => prefix-tree")
|
(title "pedestal - map-tree => prefix-tree")
|
||||||
(let [call #(pedestal/find-route pedestal-routes {:path-info "/workspace/1/1" :request-method :get})]
|
(let [call #(pedestal/find-route pedestal-router {:path-info "/workspace/1/1" :request-method :get})]
|
||||||
(assert (call))
|
(assert (call))
|
||||||
(cc/quick-bench
|
(cc/quick-bench
|
||||||
(call)))
|
(call)))
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@
|
||||||
"Creates a [[LinearRouter]] from routes and optional options.
|
"Creates a [[LinearRouter]] from routes and optional options.
|
||||||
See [[router]] for available options"
|
See [[router]] for available options"
|
||||||
([routes]
|
([routes]
|
||||||
(linear-router routes {}))
|
(linear-router routes {}))
|
||||||
([routes {:keys [compile]}]
|
([routes {:keys [compile]}]
|
||||||
(let [compiled (map (partial compile-route compile) routes)]
|
(let [compiled (map (partial compile-route compile) routes)]
|
||||||
(->LinearRouter
|
(->LinearRouter
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
"Creates a [[LookupRouter]] from routes and optional options.
|
"Creates a [[LookupRouter]] from routes and optional options.
|
||||||
See [[router]] for available options"
|
See [[router]] for available options"
|
||||||
([routes]
|
([routes]
|
||||||
(lookup-router routes {}))
|
(lookup-router routes {}))
|
||||||
([routes {:keys [compile]}]
|
([routes {:keys [compile]}]
|
||||||
(let [compiled (map (partial compile-route compile) routes)]
|
(let [compiled (map (partial compile-route compile) routes)]
|
||||||
(when-let [route (some impl/contains-wilds? (map first routes))]
|
(when-let [route (some impl/contains-wilds? (map first routes))]
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
;
|
;
|
||||||
; You must not remove this notice, or any other, from this software.
|
; You must not remove this notice, or any other, from this software.
|
||||||
|
|
||||||
(ns reitit.impl
|
(ns ^:no-doc reitit.impl
|
||||||
(:require [clojure.string :as str]
|
(:require [clojure.string :as str]
|
||||||
[clojure.set :as set])
|
[clojure.set :as set])
|
||||||
(:import #?(:clj (java.util.regex Pattern))))
|
(:import #?(:clj (java.util.regex Pattern))))
|
||||||
|
|
|
||||||
|
|
@ -119,4 +119,3 @@
|
||||||
:path "/api/user/1/2"
|
:path "/api/user/1/2"
|
||||||
:params {:id "1", :sub-id "2"}})
|
:params {:id "1", :sub-id "2"}})
|
||||||
(reitit/match-by-path router "/api/user/1/2"))))))
|
(reitit/match-by-path router "/api/user/1/2"))))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue