 
 (defrecord RequestOrContext [values queue stack])
 
-(def +items+ 100)
+(def +items+ 10)
 
 (defn expected! [x]
   (assert (= (range +items+) (:values x))))


(defn interceptor-chain-test []
  (let [interceptors (map (fn [value] [interceptor value]) (range +items+))
        app-reduce (executor-reduce (interceptor/chain interceptors identity))
        app-queue (executor-queue (interceptor/chain interceptors identity))
        app-ctx-queue (executor-ctx-queue (interceptor/chain interceptors identity))
        request {}]

    ;;  14.2 µs
    (title "interceptors - reduce")
    (expected! (app-reduce request))
    (cc/quick-bench
      (app-reduce request))

    ;;  19.4 µs
    (title "interceptors - queue")
    (expected! (app-queue request))
    (cc/quick-bench
      (app-queue request))

    ;;  30.9 µs
    (title "interceptors - ctx-queue")
    (expected! (app-ctx-queue request))
    (cc/quick-bench


(defn interceptor-test []
  (let [interceptors (map (fn [value] [interceptor value]) (range +items+))
        app (executor-reduce (interceptor/chain interceptors identity {}))
        map-request {}
        record-request (map->RequestOrContext map-request)]

    ;; 1900ns
    (title "interceptors - map")
    (expected! (app map-request))
    (cc/quick-bench
      (app map-request))

    ;; 1300ns
    (title "interceptors - record")
    (expected! (app record-request))
    (cc/quick-bench
