initial import
lisp-benchmark.lisp
Mon May 25 16:59:32 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* initial import
--- old-benchmark/lisp-benchmark.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-benchmark/lisp-benchmark.lisp 2014-10-30 07:07:36.000000000 +0100
@@ -0,0 +1,38 @@
+(in-package :cl-smoke.benchmark)
+
+(let ((array (make-instance 'qt:byte-array :args '("foobar"))))
+ (defun inline-call (iterations)
+ (declare (fixnum iterations)
+ (optimize (speed 3)))
+ (let ((char #\Null))
+ (declare (character char))
+ (dotimes (i iterations char)
+ (setf char (cxx:aref array 0))))))
+
+(let ((object (make-instance 'qt:object)))
+ (defun simple-call (iterations)
+ (declare (fixnum iterations)
+ (optimize (speed 3)))
+ (dotimes (i iterations)
+ (cxx:kill-timer object 0))))
+
+(defclass my-object (qt:object)
+ ()
+ (:metaclass cxx:class))
+
+(defmethod cxx:meta-object ((object my-object))
+ (declare (optimize (speed 3)))
+ nil)
+
+(defun overload (iterations)
+ (declare (fixnum iterations)
+ (optimize (speed 3)))
+ (let ((object (make-instance 'my-object)))
+ (dotimes (i iterations)
+ (cxx:meta-object object))))
+
+(defun construct (iterations)
+ (declare (fixnum iterations)
+ (optimize (speed 3)))
+ (dotimes (i iterations)
+ (make-instance 'qt:object)))