Wed Jul 8 17:34:16 CEST 2009 Tobias Rautenkranz * Benchmark overload resolution at compile time. diff -rN -u old-benchmark/benchmark.lisp new-benchmark/benchmark.lisp --- old-benchmark/benchmark.lisp 2014-10-30 07:06:51.000000000 +0100 +++ new-benchmark/benchmark.lisp 2014-10-30 07:06:51.000000000 +0100 @@ -39,7 +39,7 @@ (dotimes (n 3) (funcall function iterations)) ;; startup (dotimes (n 20 data) - (sb-ext:gc :full t) + (tg:gc :full t) (push (nconc (list :iterations iterations) (timing function iterations)) data)))) @@ -62,11 +62,13 @@ (defun run (&optional construct) (write-lisp-info "info.dat") (run-compare "signal-slot" #'signal-slot - #'cl-smoke-benchmark-signal-slot 5000 1000) + #'cl-smoke-benchmark-signal-slot 1000 1000) (run-compare "inline-call" #'inline-call - #'cl-smoke-benchmark-byte-array-size 50000 3000) + #'cl-smoke-benchmark-byte-array-size 10000 3000) (run-compare "simple-call" #'simple-call - #'cl-smoke-benchmark-simple-call 50000 3000) + #'cl-smoke-benchmark-simple-call 10000 3000) + (run-compare "simple-call-compile-time" #'simple-call-compile-time + #'cl-smoke-benchmark-simple-call 10000 3000) (when construct (with-benchmark-cxx-construct ((* 50 1000)) (run-compare "construct" #'construct diff -rN -u old-benchmark/cl-smoke.benchmark.mbd new-benchmark/cl-smoke.benchmark.mbd --- old-benchmark/cl-smoke.benchmark.mbd 2014-10-30 07:06:51.000000000 +0100 +++ new-benchmark/cl-smoke.benchmark.mbd 2014-10-30 07:06:51.000000000 +0100 @@ -30,4 +30,4 @@ "cxx" "lisp-benchmark" "benchmark") - (:needs :qt :cffi :sysdef.cmake)) + (:needs :qt :cffi :sysdef.cmake :trivial-garbage)) diff -rN -u old-benchmark/lisp-benchmark.lisp new-benchmark/lisp-benchmark.lisp --- old-benchmark/lisp-benchmark.lisp 2014-10-30 07:06:51.000000000 +0100 +++ new-benchmark/lisp-benchmark.lisp 2014-10-30 07:06:51.000000000 +0100 @@ -10,13 +10,24 @@ (setf char (cxx:aref array 0)))))) (let ((object (make-instance 'qt:object))) - (declare (qt:object object)) +; (declare (qt:object object)) (defun simple-call (iterations) (declare (fixnum iterations) (optimize (speed 3))) (dotimes (i iterations) (cxx:kill-timer object 0)))) +#+sbcl +(smoke::define-resolve-at-compile-time cxx:kill-timer) + +(let ((object (make-instance 'qt:object))) + (declare (qt:object object)) + (defun simple-call-compile-time (iterations) + (declare (fixnum iterations) + (optimize (speed 3))) + (dotimes (i iterations) + (cxx:kill-timer object 0)))) + (defclass my-object (qt:object) () (:metaclass cxx:class)) diff -rN -u old-benchmark/plot.R new-benchmark/plot.R --- old-benchmark/plot.R 2014-10-30 07:06:51.000000000 +0100 +++ new-benchmark/plot.R 2014-10-30 07:06:51.000000000 +0100 @@ -36,6 +36,11 @@ title("Simple Call", paste(info$TYPE[1], info$VERSION[1], "on", info$OS[1], info$OS.VERSION[1])) +cxx_simple_call <- read.table("cxx-simple-call-compile-time.dat", header=TRUE) +simple_call <- read.table("simple-call-compile-time.dat", header=TRUE) +boxplot_benchmark(simple_call, cxx_simple_call) +title("Simple Call with overload resolution at compile time.") + cxx_inline_call <- read.table("cxx-inline-call.dat", header=TRUE) inline_call <- read.table("inline-call.dat", header=TRUE) boxplot_benchmark(inline_call, cxx_inline_call)