r9336: 12 May 2004 Kevin Rosenberg (kevin@rosenberg.net)
[clsql.git] / tests / benchmarks.lisp
index 3802d5c0880d0dbb4d6c154e896813c54b688b4d..ec281d4df860e77f1b49864b6e8b3ffc36abf853 100644 (file)
     (time
      (dotimes (i n)
        (query "SELECT * FROM BENCH" :field-names nil)))
-    (format *report-stream* "~&~%*** OBJECT QUERY ***~%")
+    (format *report-stream* "~&~%*** JOINED OBJECT QUERY RETRIEVAL IMMEDIATE ***~%")
     (time
-     (dotimes (i n)
+     (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))))