Commit c38add28 authored by Stas Boukarev's avatar Stas Boukarev
Browse files

benchmarks.lisp: Add time-with-gc macro.

parent 8c5fe050
...@@ -13,12 +13,18 @@ ...@@ -13,12 +13,18 @@
(loop repeat amount (loop repeat amount
do (write-object object stream))))) do (write-object object stream)))))
(defun gc ()
#+sbcl (sb-ext:gc :full t))
(defmacro time-with-gc (&body body)
`(progn (gc)
(time (progn ,@body))))
(defun load-test () (defun load-test ()
#+sbcl (sb-ext:gc :full t)
(with-io-file (stream *test-file*) (with-io-file (stream *test-file*)
(time (time-with-gc
(loop repeat (read-next-object stream) (loop repeat (read-next-object stream)
do (read-next-object stream))))) do (read-next-object stream)))))
(defgeneric create-test-object (type &key &allow-other-keys)) (defgeneric create-test-object (type &key &allow-other-keys))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment