initial import --> to head
Sun Jan 10 11:16:40 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* ASDF & modular smoke.
hunk ./benchmark.lisp 30
- :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)))))
hunk ./benchmark.lisp 72
- #'cl-smoke-benchmark-simple-call 10000 3000)
+ #'cl-smoke-benchmark-simple-call 10000 1000)
hunk ./benchmark.sh 4
-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
hunk ./cl-smoke.benchmark.mbd 1
-;;;; -*- 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 :trivial-garbage))
rmfile ./cl-smoke.benchmark.mbd
hunk ./cxx.lisp 3
-(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))
+
hunk ./lisp-benchmark.lisp 39
- (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)))
hunk ./plot.R 39
-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.")
-
Wed Jul 8 17:34:16 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Benchmark overload resolution at compile time.
hunk ./benchmark.lisp 42
- (sb-ext:gc :full t)
+ (tg:gc :full t)
hunk ./benchmark.lisp 65
- #'cl-smoke-benchmark-signal-slot 5000 1000)
+ #'cl-smoke-benchmark-signal-slot 1000 1000)
hunk ./benchmark.lisp 67
- #'cl-smoke-benchmark-byte-array-size 50000 3000)
+ #'cl-smoke-benchmark-byte-array-size 10000 3000)
hunk ./benchmark.lisp 69
- #'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)
hunk ./cl-smoke.benchmark.mbd 33
- (:needs :qt :cffi :sysdef.cmake))
+ (:needs :qt :cffi :sysdef.cmake :trivial-garbage))
hunk ./lisp-benchmark.lisp 13
- (declare (qt:object object))
+; (declare (qt:object object))
hunk ./lisp-benchmark.lisp 20
+#+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))))
+
hunk ./plot.R 39
+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.")
+
Fri Jun 19 17:31:27 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* add signal-slot benchmark & better graphs
hunk ./CMakeLists.txt 5
+set(CXX_BENCHMARK_SOURCES
+ benchmark.cpp construct.cpp overload.cpp simple-call.cpp signal_slot.cpp)
+
+qt4_automoc(signal_slot.cpp)
+
hunk ./CMakeLists.txt 16
-add_library(cl-smoke-benchmark MODULE benchmark.cpp construct.cpp overload.cpp simple-call.cpp)
+add_library(cl-smoke-benchmark MODULE ${CXX_BENCHMARK_SOURCES})
hunk ./benchmark.cpp 9
-CL_SMOKE_BENCHMARK_EXPORT char
+CL_SMOKE_BENCHMARK_EXPORT void
hunk ./benchmark.cpp 12
- char a;
hunk ./benchmark.cpp 13
- a += array.at(0);
-
- return a;
+ array.at(0);
hunk ./benchmark.lisp 10
- (list :processor-cycles (getf timings :processor-cycles))))
+ (list :processor-cycles (getf timings :processor-cycles)
+ :system-run-time-us (getf timings :system-run-time-us)
+ :user-run-time-us (getf timings :user-run-time-us))))
hunk ./benchmark.lisp 27
+(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)))))
+ file))
hunk ./benchmark.lisp 37
-(defun benchmark (function &rest args)
+(defun benchmark (function iterations)
hunk ./benchmark.lisp 39
+ (dotimes (n 3)
+ (funcall function iterations)) ;; startup
hunk ./benchmark.lisp 43
- (push (apply #'timing function args)
+ (push (nconc (list :iterations iterations)
+ (timing function iterations))
hunk ./benchmark.lisp 47
-(defun run-compare (name function cxx-function iterations)
- (let ((data (benchmark function iterations))
- (cxx-data (benchmark cxx-function iterations))
+(defun run-compare (name function cxx-function iterations multiplier)
+ (format t "running ~A." name)
+ (let ((data (prog1 (benchmark function iterations) (princ ".")))
+ (cxx-data (prog1 (benchmark cxx-function (* multiplier iterations))
+ (princ ".")))
hunk ./benchmark.lisp 59
- (pathname-name file))))))
+ (pathname-name file)))))
+ (terpri))
hunk ./benchmark.lisp 62
-(defun run ()
- (run-compare "overload" #'overload #'cl-smoke-benchmark-overload 1000)
+(defun run (&optional construct)
+ (write-lisp-info "info.dat")
+ (run-compare "signal-slot" #'signal-slot
+ #'cl-smoke-benchmark-signal-slot 5000 1000)
hunk ./benchmark.lisp 67
- #'cl-smoke-benchmark-byte-array-size 1000)
+ #'cl-smoke-benchmark-byte-array-size 50000 3000)
hunk ./benchmark.lisp 69
- #'cl-smoke-benchmark-simple-call 1000)
- (with-benchmark-cxx-construct (1000)
- (run-compare "construct" #'construct
- #'cl-smoke-benchmark-construct 1000)))
+ #'cl-smoke-benchmark-simple-call 50000 3000)
+ (when construct
+ (with-benchmark-cxx-construct ((* 50 1000))
+ (run-compare "construct" #'construct
+ #'cl-smoke-benchmark-construct 1000 50))))
hunk ./benchmark.sh 4
-sbcl --eval "(mb:load :cl-smoke.benchmark)" --eval "(cl-smoke.benchmark::run)" --eval "(quit)" || exit 1
-R --no-save < ./plot.R
+sbcl --eval "(mb:load :cl-smoke.benchmark)" --eval "(cl-smoke.benchmark:run)" --eval "(quit)" || exit 1
+R --no-save < ./plot.R > /dev/null
hunk ./cl-smoke.benchmark.mbd 24
- (:documentation "Benchmark cl-smoke agains C++."
+ (:documentation "Benchmark cl-smoke agains C++.")
hunk ./cxx.lisp 6
-(defcfun cl-smoke-benchmark-byte-array-size :char
+(declaim (inline cl-smoke-benchmark-byte-array-size))
+(defcfun cl-smoke-benchmark-byte-array-size :void
hunk ./cxx.lisp 10
+(declaim (inline cl-smoke-benchmark-overload))
hunk ./cxx.lisp 14
+(declaim (inline cl-smoke-benchmark-signal-slot))
+(defcfun cl-smoke-benchmark-signal-slot :void
+ (iterations size-t))
hunk ./cxx.lisp 21
+(declaim (inline cl-smoke-benchmark-construct))
hunk ./lisp-benchmark.lisp 13
+ (declare (qt:object object))
hunk ./lisp-benchmark.lisp 24
-(defmethod cxx:meta-object ((object my-object))
- (declare (optimize (speed 3)))
- nil)
hunk ./lisp-benchmark.lisp 25
-(defun overload (iterations)
+(defun signal-slot (iterations)
hunk ./lisp-benchmark.lisp 28
- (let ((object (make-instance 'my-object)))
+ (let ((my-signal (make-instance 'cl-smoke.qt-impl::qsignal :argument-types nil)))
+ (declare (function my-signal))
+ (qt:connect my-signal
+ #'(lambda ()))
hunk ./lisp-benchmark.lisp 33
- (cxx:meta-object object))))
+ (funcall my-signal))))
+ [_$_]
hunk ./package.lisp 2
- (:use :cl :cxx-support :cffi))
+ (:use :cl :cxx-support :cffi)
+ (:export #:run))
hunk ./plot.R 3
+round_to_signif <- function(value, deviation) {
+ round(value, -floor(log(deviation)/log(10)))
+}
hunk ./plot.R 8
+ iterations <- lisp_data$ITERATIONS[1]
+ cxx_iterations <- cxx_data$ITERATIONS[1]
+ cxx_multiplier <- iterations / cxx_iterations
+
hunk ./plot.R 13
- boxplot(c(cxx_data["PROCESSOR.CYCLES"]/cxx_mean, lisp_data["PROCESSOR.CYCLES"]/cxx_mean),
+ scaled_lisp_data <- lisp_data["PROCESSOR.CYCLES"]/cxx_mean/cxx_multiplier;
+ par(mfrow=c(1,2))
+ boxplot(c(cxx_data["PROCESSOR.CYCLES"]/cxx_mean, scaled_lisp_data),
hunk ./plot.R 17
+ axis(4, at=c(round_to_signif(mean(scaled_lisp_data),
+ sd(scaled_lisp_data))))
+
+ cxx_mean <- mean(cxx_data$USER.RUN.TIME.US)
+ scaled_lisp_data <- lisp_data["USER.RUN.TIME.US"]/cxx_mean/cxx_multiplier;
+ boxplot(c(cxx_data["USER.RUN.TIME.US"]/cxx_mean, scaled_lisp_data),
+ log="y", names=c("C++", "Lisp"), ylab="user run time")
+ axis(4, at=c(round_to_signif(mean(scaled_lisp_data),
+ sd(scaled_lisp_data))))
+ par(mfrow=c(1,1))
hunk ./plot.R 29
-pdf("benchmark.pdf")
+pdf("benchmark.pdf", title="cl-smoke.benchmark")
+
+info <- read.table("info.dat", header=TRUE)
hunk ./plot.R 36
-title("Simple Call")
+title("Simple Call",
+ paste(info$TYPE[1], info$VERSION[1], "on", info$OS[1], info$OS.VERSION[1]))
hunk ./plot.R 44
-cxx_overload <- read.table("cxx-overload.dat", header=TRUE)
-overload <- read.table("overload.dat", header=TRUE)
-boxplot_benchmark(overload, cxx_overload)
-title("Overload Virtual Function")
-
+cxx_signal_slot <- read.table("cxx-signal-slot.dat", header=TRUE)
+signal_slot <- read.table("signal-slot.dat", header=TRUE)
+boxplot_benchmark(signal_slot, cxx_signal_slot)
+title("Signal Slot")
hunk ./plot.R 49
-cxx_construct <- read.table("cxx-construct.dat", header=TRUE)
-construct <- read.table("construct.dat", header=TRUE)
-boxplot_benchmark(construct, cxx_construct)
-title("Construct Class")
+#cxx_construct <- read.table("cxx-construct.dat", header=TRUE)
+#construct <- read.table("construct.dat", header=TRUE)
+#boxplot_benchmark(construct, cxx_construct)
+#title("Construct Class")
addfile ./signal_slot.cpp
hunk ./signal_slot.cpp 1
+#include "signal_slot.h"
+#include "signal_slot.moc"
+
+#include "benchmark.h"
+
+void
+signal_object::my_slot()
+{
+}
+
+extern "C" {
+
+CL_SMOKE_BENCHMARK_EXPORT void
+cl_smoke_benchmark_signal_slot(size_t iterations)
+{
+ signal_object object;
+ bool ret = QObject::connect(&object, SIGNAL(my_signal()), &object, SLOT(my_slot()));
+ Q_ASSERT(ret);
+
+ for (size_t i=0; i<iterations; i++)
+ object.emit_my_signal();
+}
+
+} // extern "C"
addfile ./signal_slot.h
hunk ./signal_slot.h 1
+#ifndef CL_SMOKE_BENCHMARK_SIGNAL_SLOT_H
+#define CL_SMOKE_BENCHMARK_SIGNAL_SLOT_H
+
+#include <QObject>
+
+class signal_object : public QObject
+{
+ Q_OBJECT
+ public:
+ void
+ emit_my_signal()
+ { emit my_signal(); }
+
+ signals:
+ void
+ my_signal();
+
+ public slots:
+ void
+ my_slot();
+};
+
+#endif // CL_SMOKE_BENCHMARK_SIGNAL_SLOT_H
Mon May 25 16:59:32 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* initial import
addfile ./CMakeLists.txt
hunk ./CMakeLists.txt 1
+find_package(Qt4)
+set(QT_DONT_USE_QTGUI true)
+include(${QT_USE_FILE})
+
+include(CheckCXXCompilerFlag)
+check_cxx_compiler_flag("-fvisibility=hidden" CXX_VISIBILITY)
+if(CXX_VISIBILITY)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
+endif(CXX_VISIBILITY)
+
+add_library(cl-smoke-benchmark MODULE benchmark.cpp construct.cpp overload.cpp simple-call.cpp)
+target_link_libraries(cl-smoke-benchmark ${QT_LIBRARIES})
addfile ./benchmark.cpp
hunk ./benchmark.cpp 1
+#include "benchmark.h"
+
+#include <QByteArray>
+
+static QByteArray array("foobar");
+
+extern "C" {
+
+CL_SMOKE_BENCHMARK_EXPORT char
+cl_smoke_benchmark_byte_array_size(size_t iterations)
+{
+ char a;
+ for(size_t i=0; i< iterations; i++)
+ a += array.at(0);
+
+ return a;
+}
+
+} // extern "C"
addfile ./benchmark.lisp
hunk ./benchmark.lisp 1
+(in-package :cl-smoke.benchmark)
+
+(defun timing (function &rest arguments)
+ (let ((timings))
+ (apply #'sb-ext:call-with-timing
+ #'(lambda (&rest args)
+ (setf timings args))
+ function
+ arguments)
+ (list :processor-cycles (getf timings :processor-cycles))))
+
+(defun print-header (stream data)
+ (dolist (d (alexandria:plist-alist (first data)))
+ (format stream "~A " (first d)))
+ (format stream "~%"))
+
+(defun write-R-table (data file)
+ (with-open-file (out file :direction :output)
+ (print-header out data)
+ (dolist (d data)
+ (dolist (e (alexandria:plist-alist d))
+ (format out "~S~T" (rest e)))
+ (format out "~%"))))
+
+
+(defun benchmark (function &rest args)
+ (let ((data))
+ (dotimes (n 20 data)
+ (sb-ext:gc :full t)
+ (push (apply #'timing function args)
+ data))))
+
+(defun run-compare (name function cxx-function iterations)
+ (let ((data (benchmark function iterations))
+ (cxx-data (benchmark cxx-function iterations))
+ (file (make-pathname :defaults name
+ :type "dat")))
+ (write-R-table data file)
+ (write-R-table cxx-data
+ (make-pathname :defaults file
+ :name (concatenate 'string
+ "cxx-"
+ (pathname-name file))))))
+
+(defun run ()
+ (run-compare "overload" #'overload #'cl-smoke-benchmark-overload 1000)
+ (run-compare "inline-call" #'inline-call
+ #'cl-smoke-benchmark-byte-array-size 1000)
+ (run-compare "simple-call" #'simple-call
+ #'cl-smoke-benchmark-simple-call 1000)
+ (with-benchmark-cxx-construct (1000)
+ (run-compare "construct" #'construct
+ #'cl-smoke-benchmark-construct 1000)))
addfile ./benchmark.sh
hunk ./benchmark.sh 1
+#!/bin/sh
+
+rm -- *.dat
+sbcl --eval "(mb:load :cl-smoke.benchmark)" --eval "(cl-smoke.benchmark::run)" --eval "(quit)" || exit 1
+R --no-save < ./plot.R
addfile ./cl-smoke.benchmark.mbd
hunk ./cl-smoke.benchmark.mbd 1
+;;;; -*- 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))
addfile ./construct.cpp
hunk ./construct.cpp 1
+#include "benchmark.h"
+
+#include <QObject>
+#include <QVector>
+
+static QVector<QObject*> a;
+
+extern "C" {
+
+CL_SMOKE_BENCHMARK_EXPORT void
+cl_smoke_benchmark_construct_setup(size_t iterations)
+{
+ a.resize(iterations);
+}
+
+CL_SMOKE_BENCHMARK_EXPORT char
+cl_smoke_benchmark_construct(size_t iterations)
+{
+ Q_ASSERT(a.size() == iterations);
+[_^I_][_$_]
+ for (size_t i=0; i<iterations; i++)
+ a[i] = new QObject();
+}
+
+CL_SMOKE_BENCHMARK_EXPORT void
+cl_smoke_benchmark_construct_cleanup(size_t iterations)
+{
+ Q_ASSERT(a.size() == iterations);
+
+ for (size_t i=0; i<iterations; i++)
+ delete a[i];
+
+ a.clear();
+}
+
+}
addfile ./cxx.lisp
hunk ./cxx.lisp 1
+(in-package :cl-smoke.benchmark)
+
+(use-foreign-library libcl-smoke-benchmark)
+(defctype size-t :unsigned-int)
+
+(defcfun cl-smoke-benchmark-byte-array-size :char
+ (iterations size-t))
+
+(defcfun cl-smoke-benchmark-overload :unsigned-int
+ (iterations size-t))
+
+
+(defcfun cl-smoke-benchmark-construct-setup :void
+ (iterations size-t))
+
+(defcfun cl-smoke-benchmark-construct :char
+ (iterations size-t))
+
+(defcfun cl-smoke-benchmark-construct-cleanup :void
+ (iterations size-t))
+
+
+(defmacro with-benchmark-cxx-construct ((iterations) &body body)
+ `(progn
+ (cl-smoke-benchmark-construct-setup ,iterations)
+ ,@body
+ (cl-smoke-benchmark-construct-cleanup ,iterations)))
+
+
+(defcfun cl-smoke-benchmark-simple-call :void
+ (iterations size-t))
addfile ./lisp-benchmark.lisp
hunk ./lisp-benchmark.lisp 1
+(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)))
addfile ./overload.cpp
hunk ./overload.cpp 1
+#include "benchmark.h"
+
+#include <QObject>
+#include <QMetaObject>
+
+class my_object : public QObject
+{
+ public:
+ virtual const QMetaObject*
+ metaObject() const
+ { return NULL; }
+};
+
+extern "C" {
+
+CL_SMOKE_BENCHMARK_EXPORT unsigned
+cl_smoke_benchmark_overload(size_t iterations)
+{
+ my_object object;
+ QObject& o = object;
+ unsigned m = 0;
+
+ for (size_t i=0; i<iterations; i++)
+ m += reinterpret_cast<unsigned>(o.metaObject());
+
+ return m;
+}
+
+} // extern "C"
addfile ./package.lisp
hunk ./package.lisp 1
+(defpackage :cl-smoke.benchmark
+ (:use :cl :cxx-support :cffi))
addfile ./plot.R
hunk ./plot.R 1
+#!/usr/bin/R
+
+
+boxplot_benchmark <- function(lisp_data, cxx_data) {
+ cxx_mean <- mean(cxx_data$PROCESSOR.CYCLES)
+ boxplot(c(cxx_data["PROCESSOR.CYCLES"]/cxx_mean, lisp_data["PROCESSOR.CYCLES"]/cxx_mean),
+ log="y", names=c("C++", "Lisp"), ylab="processor cycles")
+}
+
+pdf("benchmark.pdf")
+
+cxx_simple_call <- read.table("cxx-simple-call.dat", header=TRUE)
+simple_call <- read.table("simple-call.dat", header=TRUE)
+boxplot_benchmark(simple_call, cxx_simple_call)
+title("Simple Call")
+
+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)
+title("Inline Call")
+
+cxx_overload <- read.table("cxx-overload.dat", header=TRUE)
+overload <- read.table("overload.dat", header=TRUE)
+boxplot_benchmark(overload, cxx_overload)
+title("Overload Virtual Function")
+
+
+cxx_construct <- read.table("cxx-construct.dat", header=TRUE)
+construct <- read.table("construct.dat", header=TRUE)
+boxplot_benchmark(construct, cxx_construct)
+title("Construct Class")
addfile ./simple-call.cpp
hunk ./simple-call.cpp 1
+#include "benchmark.h"
+
+#include <QObject>
+
+static QObject object;
+
+extern "C" {
+
+CL_SMOKE_BENCHMARK_EXPORT void
+cl_smoke_benchmark_simple_call(size_t iterations)
+{
+ for (size_t i=0; i<iterations; i++)
+ object.killTimer(0);
+}
+
+} // extern "C"