Skip to content

Instantly share code, notes, and snippets.

@bsless
Last active June 5, 2021 07:49
Show Gist options
  • Save bsless/18d79130479d94ce0256d53a78b31c64 to your computer and use it in GitHub Desktop.
Save bsless/18d79130479d94ce0256d53a78b31c64 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(require '[sieppari.queue :as q])
(require '[sieppari.core :as s])
(require '[clj-async-profiler.core :as prof])
(require '[criterium.core :as cc])
(def +items+ 10)
(def interceptors (conj (mapv (fn [value] {:enter identity}) (range +items+)) identity))
(def queue (q/into-queue interceptors))
(def map-request {})
(defrecord RequestOrContext [values queue stack])
(def record-request (map->RequestOrContext map-request))
(def app (fn [req] (s/execute queue req)))
(app record-request)
(cc/quick-bench (app record-request))
;; (prof/clear-results)
(prof/serve-files 7777)
(prof/profile
(time (dotimes [_ 1e7] (app record-request))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment