         app2 (fn [req] (sieppari.core/execute queue req))]
 
     ;; 5500ns
+    ;; 4000ns (identity)
     (title "sieppari - map")
     (expected! (app map-request))
     (cc/quick-bench
       (app map-request))
 
     ;; 4600ns
+    ;; 3800ns (identity)
     (title "sieppari - record")
     (expected! (app record-request))
     (cc/quick-bench
       (app record-request))
 
     ;; 2200ns
+    ;; 1300ns (identity)
     (title "sieppari - map (compiled queue)")
     (expected! (app2 map-request))
     (cc/quick-bench
       (app2 map-request))
 
     ;; 1600ns
+    ;; 1300ns (identity)
     (title "sieppari - record (compiled queue)")
     (expected! (app2 record-request))
     (cc/quick-bench

(defn pedestal-chain-text []
  (let [is (map io.pedestal.interceptor/interceptor
                (map (fn [value]
                       {:enter (interceptor value)}) (range +items+)))
        ctx (io.pedestal.interceptor.chain/enqueue nil is)]

    ;; 8400ns
    (title "pedestal")
    (cc/quick-bench
      (io.pedestal.interceptor.chain/execute ctx))))

#_(defn pedestal-tuned-chain-text []
    (let [is (map io.pedestal.interceptor/interceptor
                  (map (fn [value]
                         {:enter (interceptor value)}) (range +items+)))
          ctx (reitit.chain/map->Context (reitit.chain/enqueue nil is))]

      ;; 67 µs
      (title "pedestal - tuned")
      (cc/quick-bench
        (reitit.chain/execute ctx))))

;;
;; Naive chain

(def +items+ 10)

(defn expected! [x]
  (println x)
  #_(assert (= (range +items+) (:values x))))

(defn middleware [handler value]
  (fn [request]
    (handler request)))

(def map-request {})
(def record-request (map->RequestOrContext map-request))
