Benchmark overload resolution at compile time. --> to head
Sun Jan 10 11:16:40 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* ASDF & modular smoke.
Wed Jul 8 17:34:16 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* 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:50.000000000 +0100
+++ new-benchmark/benchmark.lisp 2014-10-30 07:06:50.000000000 +0100
@@ -27,11 +27,12 @@
(defun write-lisp-info (file)
(write-R-table
`((:type ,(lisp-implementation-type)
- :version ,(lisp-implementation-version)
- :arch ,(machine-type)
- :os ,(software-type)
- :os-version ,(software-version)
- :cl-smoke-version ,(mb.sysdef::version-string (mb.sysdef:version-of (mb.sysdef:find-system :smoke)))))
+ :version ,(lisp-implementation-version)
+ :arch ,(machine-type)
+ :os ,(software-type)
+ :os-version ,(software-version)
+ :cl-smoke-version ,(format nil "~{~A~^.~}"
+ (asdf:component-version (asdf:find-system :cl-smoke.smoke)))))
file))
(defun benchmark (function iterations)
@@ -39,7 +40,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 +63,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 1000)
(when construct
(with-benchmark-cxx-construct ((* 50 1000))
(run-compare "construct" #'construct
diff -rN -u old-benchmark/benchmark.sh new-benchmark/benchmark.sh
--- old-benchmark/benchmark.sh 2014-10-30 07:06:50.000000000 +0100
+++ new-benchmark/benchmark.sh 2014-10-30 07:06:50.000000000 +0100
@@ -1,5 +1,7 @@
#!/bin/sh
rm -- *.dat
-sbcl --eval "(mb:load :cl-smoke.benchmark)" --eval "(cl-smoke.benchmark:run)" --eval "(quit)" || exit 1
+sbcl --eval "(require :cl-smoke.benchmark)" \
+ --eval "(cl-smoke.benchmark:run)" \
+ --eval "(quit)" || exit 1
R --no-save < ./plot.R > /dev/null
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:50.000000000 +0100
+++ new-benchmark/cl-smoke.benchmark.mbd 1970-01-01 01:00:00.000000000 +0100
@@ -1,33 +0,0 @@
-;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
-
-
-;;; SYSDEF.CMAKE
-(defpackage :sysdef.cmake
- (:use :cl :sysdef)
- (:export :cmake-file :cmake-library))
-
-(in-package :sysdef.cmake)
-(defclass sysdef.cmake:cmake-file (source-file)
- ()
- (:default-initargs :type "txt"))
-
-(defclass sysdef.cmake:cmake-library (component)
- ())
-;;; end SYSDEF.CMAKE
-
-(in-package :sysdef-user)
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (use-package :sysdef.cmake))
-
-(define-system :cl-smoke.benchmark ()
- (:version 0 0 1)
- (:documentation "Benchmark cl-smoke agains C++.")
- (:serial t)
- (:components
- "package"
- ("CMakeLists" sysdef.cmake:cmake-file)
- ("libcl-smoke-benchmark" sysdef.cmake:cmake-library)
- "cxx"
- "lisp-benchmark"
- "benchmark")
- (:needs :qt :cffi :sysdef.cmake))
diff -rN -u old-benchmark/cxx.lisp new-benchmark/cxx.lisp
--- old-benchmark/cxx.lisp 2014-10-30 07:06:50.000000000 +0100
+++ new-benchmark/cxx.lisp 2014-10-30 07:06:50.000000000 +0100
@@ -1,6 +1,13 @@
(in-package :cl-smoke.benchmark)
-(use-foreign-library libcl-smoke-benchmark)
+(define-foreign-library libcl-smoke-benchmark
+ (t (:default "libcl-smoke-benchmark")))
+
+(let ((*foreign-library-directories*
+ (cons (asdf:component-pathname (asdf:find-system :cl-smoke.benchmark))
+ *foreign-library-directories*)))
+ (use-foreign-library libcl-smoke-benchmark))
+
(defctype size-t :unsigned-int)
(declaim (inline cl-smoke-benchmark-byte-array-size))
diff -rN -u old-benchmark/lisp-benchmark.lisp new-benchmark/lisp-benchmark.lisp
--- old-benchmark/lisp-benchmark.lisp 2014-10-30 07:06:50.000000000 +0100
+++ new-benchmark/lisp-benchmark.lisp 2014-10-30 07:06:50.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))
@@ -25,7 +36,7 @@
(defun signal-slot (iterations)
(declare (fixnum iterations)
(optimize (speed 3)))
- (let ((my-signal (make-instance 'cl-smoke.qt-impl::qsignal :argument-types nil)))
+ (let ((my-signal (make-instance 'cl-smoke.qt.core::qsignal :argument-types nil)))
(declare (function my-signal))
(qt:connect my-signal
#'(lambda ()))