From 0cd2c5c91b32a5cf24a72291d922806b95a383c6 Mon Sep 17 00:00:00 2001 From: Nathan Bird Date: Tue, 19 Jan 2010 10:27:22 -0500 Subject: [PATCH] Fixing benchmarks that depend on the *ds-employees* dataset. --- tests/benchmarks.lisp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/benchmarks.lisp b/tests/benchmarks.lisp index 97e983b..66dfb3e 100644 --- a/tests/benchmarks.lisp +++ b/tests/benchmarks.lisp @@ -67,17 +67,19 @@ (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) + (with-dataset *ds-employees* + (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)))) - (setf (gethash :retrieval dbi) :immediate)))) + (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))))) -- 2.34.1