From ed81c07da563c7fa6c6914a88fe753282a9cf0b4 Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Wed, 8 Aug 2018 11:25:58 +0300 Subject: [PATCH] CHANGELOG & update perf tests --- CHANGELOG.md | 1 + perf-test/clj/reitit/go_perf_test.clj | 6 +++--- perf-test/clj/reitit/opensensors_perf_test.clj | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b70436b..822b9258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * should only concern you if you are not using [Muuntaja](https://github.com/metosin/muuntaja). * the `r/routes` returns just the path + data tuples as documented, not the compiled route results. To get the compiled results, use `r/compiled-routes` instead. * new [faster](https://github.com/metosin/reitit/blob/master/perf-test/clj/reitit/impl_perf_test.clj) and more correct encoders and decoders for query & path params. + * all path-parameters are now decoded correctly with `reitit.impl/url-decode`, thanks to [Matthew Davidson](https://github.com/KingMob)! * query-parameters are encoded with `reitit.impl/form-encode`, so spaces are `+` instead of `%20`. * correctly read `:header` params from request `:headers`, not `:header-params` * welcome route name conflict resolution! If router has routes with same names, router can't be created. fix 'em. diff --git a/perf-test/clj/reitit/go_perf_test.clj b/perf-test/clj/reitit/go_perf_test.clj index 5c5dd175..1e6b502b 100644 --- a/perf-test/clj/reitit/go_perf_test.clj +++ b/perf-test/clj/reitit/go_perf_test.clj @@ -92,9 +92,9 @@ ;; 200ns (4.8x) "httpRouter" - ;; 77ns - ;; 700ns - ;; 890ns + ;; 77ns -> 120ns (decode path-params) + ;; 700ns -> 795ns (decode path-params) + ;; 890ns -> 1000ns (decode path-params) (title "reitit-ring") (let [r1 (map->Request {:request-method :get, :uri "/1/users"}) r2 (map->Request {:request-method :get, :uri "/1/classes/go"}) diff --git a/perf-test/clj/reitit/opensensors_perf_test.clj b/perf-test/clj/reitit/opensensors_perf_test.clj index 2beba938..9ca7734c 100644 --- a/perf-test/clj/reitit/opensensors_perf_test.clj +++ b/perf-test/clj/reitit/opensensors_perf_test.clj @@ -438,6 +438,8 @@ ;; 2316ns ;; 819ns (prefix-tree-router) ;; 723ns (segment-router) + ;; 702ns (before path-parameters) + ;; 806ns (decode path-parameters) (b! "reitit-ring" reitit-ring-f) ;; 2821ns