Fixing benchmarks that depend on the *ds-employees* dataset.
authorNathan Bird <nathan@acceleration.net>
Tue, 19 Jan 2010 15:27:22 +0000 (10:27 -0500)
committerNathan Bird <nathan@acceleration.net>
Tue, 19 Jan 2010 15:27:22 +0000 (10:27 -0500)
tests/benchmarks.lisp

index 97e983b121ef5a475acd692fb1836e6cb714c6e9..66dfb3e75934e2d859691627f34e2990b8eaaa63 100644 (file)
     (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)))))