X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=tests%2Fbenchmarks.lisp;h=66800eb530df19c37fb88fb5eb3a1fa4c6f82920;hp=eb218b6791441299881ae95bca36e7a06934a931;hb=d9f41af62750c622945bb17b622a39689ee5b840;hpb=d26a044593b10e62d1ba1c7b80266f55bc100d5d diff --git a/tests/benchmarks.lisp b/tests/benchmarks.lisp index eb218b6..66800eb 100644 --- a/tests/benchmarks.lisp +++ b/tests/benchmarks.lisp @@ -3,7 +3,7 @@ ;;;; File: benchmarks.lisp ;;;; Authors: Kevin Rosenberg ;;;; Created: 03/05/2004 -;;;; Updated: $Id: test-init.lisp 9212 2004-05-03 18:44:03Z kevin $ +;;;; Updated: $Id$ ;;;; ;;;; Benchmark suite ;;;; @@ -42,6 +42,7 @@ (defun do-benchmarks-for-backend (db-type spec count) (test-connect-to-database db-type spec) + (test-initialise-database) (write-report-banner "Benchmarks" db-type *report-stream*) (create-view-from-class 'bench) @@ -67,8 +68,17 @@ (time (dotimes (i n) (query "SELECT * FROM BENCH" :field-names nil))) - )) - - - + (format *report-stream* "~&~%*** JOINED OBJECT QUERY RETRIEVAL IMMEDIATE ***~%") + (time + (dotimes (i (truncate n 10)) + (mapcar #'(lambda (ea) (slot-value ea 'address)) (select 'employee-address :flatp t)))) + (format *report-stream* "~&~%*** JOINED OBJECT QUERY RETRIEVAL DEFERRED ***~%") + (let* ((slotdef (find 'address (clsql-sys::class-slots (find-class 'employee-address)) + :key #'clsql-sys::slot-definition-name)) + (dbi (when slotdef (clsql-sys::view-class-slot-db-info slotdef)))) + (setf (gethash :retrieval dbi) :deferred) + (time + (dotimes (i (truncate n 10)) + (mapcar #'(lambda (ea) (slot-value ea 'address)) (select 'employee-address :flatp t)))) + (setf (gethash :retrieval dbi) :immediate))))