/
lisp-benchmark.lisp
1 (in-package :cl-smoke.benchmark)
2
3 (let ((array (make-instance 'qt:byte-array :args '("foobar"))))
4 (defun inline-call (iterations)
5 (declare (fixnum iterations)
6 (optimize (speed 3)))
7 (let ((char #\Null))
8 (declare (character char))
9 (dotimes (i iterations char)
10 (setf char (cxx:aref array 0))))))
11
12 (let ((object (make-instance 'qt:object)))
13 ; (declare (qt:object object))
14 (defun simple-call (iterations)
15 (declare (fixnum iterations)
16 (optimize (speed 3)))
17 (dotimes (i iterations)
18 (cxx:kill-timer object 0))))
19
20 #+sbcl
21 (smoke::define-resolve-at-compile-time cxx:kill-timer)
22
23 (let ((object (make-instance 'qt:object)))
24 (declare (qt:object object))
25 (defun simple-call-compile-time (iterations)
26 (declare (fixnum iterations)
27 (optimize (speed 3)))
28 (dotimes (i iterations)
29 (cxx:kill-timer object 0))))
30
31 (defclass my-object (qt:object)
32 ()
33 (:metaclass cxx:class))
34
35
36 (defun signal-slot (iterations)
37 (declare (fixnum iterations)
38 (optimize (speed 3)))
39 (let ((my-signal (make-instance 'cl-smoke.qt.core::qsignal :argument-types nil)))
40 (declare (function my-signal))
41 (qt:connect my-signal
42 #'(lambda ()))
43 (dotimes (i iterations)
44 (funcall my-signal))))
45
46
47 (defun construct (iterations)
48 (declare (fixnum iterations)
49 (optimize (speed 3)))
50 (dotimes (i iterations)
51 (make-instance 'qt:object)))