Bench entire call->dispatch flow

This commit is contained in:
Peter Taoussanis 2015-05-28 15:40:37 +07:00
parent 9b4c760173
commit 621ffe83d1
1 changed files with 10 additions and 0 deletions

View File

@ -275,6 +275,16 @@
(qb 10000 (log? :trace "foo")) ; ~6ms
(qb 10000 (tracef "foo")) ; ~7.5ms
(qb 10000 (when false "foo")) ; ~0.5ms
;;; Full benchmarks
(defmacro with-sole-appender [appender & body]
`(with-config (assoc *config* :appenders {:appender ~appender}) ~@body))
(with-sole-appender {:enabled? true :fn (fn [data] nil)}
(qb 10000 (info "foo"))) ; ~88ms ; Time to delays ready
(with-sole-appender {:enabled? true :fn (fn [data] ((:output-fn data) data))}
(qb 10000 (info "foo"))) ; ~218ms ; Time to output ready
)
(def ^:dynamic *context*