30% better perf than segment-router in os-test

This commit is contained in:
Tommi Reiman 2019-02-02 18:23:49 +02:00
parent 1d6cec7148
commit ff944c455b

View file

@ -570,7 +570,8 @@
;; 662ns (prefix-tree-router) ;; 662ns (prefix-tree-router)
;; 567ns (segment-router) ;; 567ns (segment-router)
;; 326ns (java-segment-router) ;; 326ns (java-segment-router)
;; 194ms (trie) ;; 194ns (trie)
;; 160ns (trie, prioritized)
(b! "reitit" reitit-f) (b! "reitit" reitit-f)
;; 2845ns ;; 2845ns
@ -581,51 +582,46 @@
;; 806ns (decode path-parameters) ;; 806ns (decode path-parameters)
;; 735ns (maybe-map-values) ;; 735ns (maybe-map-values)
;; 474ns (java-segment-router) ;; 474ns (java-segment-router)
;; 373ms (trie) ;; 373ns (trie)
#_(b! "reitit-ring" reitit-ring-f) ;; 323ns (trie, prioritized)
(b! "reitit-ring" reitit-ring-f)
;; 385ns (java-segment-router, no injects) ;; 385ns (java-segment-router, no injects)
;; 271ms (trie) ;; 271ms (trie)
#_(b! "reitit-ring-fast" reitit-ring-fast-f) ;; 240ns (trie, prioritized)
(b! "reitit-ring-fast" reitit-ring-fast-f)
;; 2553ns (linear-router) ;; 2553ns (linear-router)
;; 630ns (segment-router-backed) ;; 630ns (segment-router-backed)
#_(b! "reitit-ring-linear" reitit-ring-linear-f) (b! "reitit-ring-linear" reitit-ring-linear-f)
;; 2137ns ;; 2137ns
#_(b! "calfpath-walker" calfpath-walker-f) (b! "calfpath-walker" calfpath-walker-f)
;; 4774ns ;; 4774ns
#_(b! "calfpath-unroll" calfpath-unroll-f) (b! "calfpath-unroll" calfpath-unroll-f)
;; 2821ns ;; 2821ns
#_(b! "pedestal" pedestal-f) (b! "pedestal" pedestal-f)
;; 4803ns ;; 4803ns
#_(b! "calfpath-macros" calfpath-macros-f) (b! "calfpath-macros" calfpath-macros-f)
;; 11615ns ;; 11615ns
#_(b! "compojure" compojure-f) (b! "compojure" compojure-f)
;; 15034ns ;; 15034ns
#_(b! "bidi" bidi-f) (b! "bidi" bidi-f)
;; 19688ns ;; 19688ns
#_(b! "ataraxy" ataraxy-f))) (b! "ataraxy" ataraxy-f)))
(comment (comment
(bench-rest!)) (bench-rest!))
(-> opensensors-routes
trie/insert
trie/compile
trie/pretty)
(set! *warn-on-reflection* true)
(require '[clj-async-profiler.core :as prof])
(comment (comment
(set! *warn-on-reflection* true)
(require '[clj-async-profiler.core :as prof])
;; 629ms (arraylist) ;; 629ms (arraylist)
;; 409ns (transient) ;; 409ns (transient)
;; 409ns (staticMultiMatcher) ;; 409ns (staticMultiMatcher)