X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Fbenchmarks.lisp;h=16e3e78f8b34cdc2ccc6f0db411302b09ace9654;hb=26720328bdd7d8f28c3247063c477f05f3a7251e;hp=97e983b121ef5a475acd692fb1836e6cb714c6e9;hpb=9374619101fdb679974192b5939c0eb15e31c39d;p=clsql.git diff --git a/tests/benchmarks.lisp b/tests/benchmarks.lisp index 97e983b..16e3e78 100644 --- a/tests/benchmarks.lisp +++ b/tests/benchmarks.lisp @@ -42,7 +42,8 @@ (defun do-benchmarks-for-backend (db-type spec count) (test-connect-to-database db-type spec) - (write-report-banner "Benchmarks" db-type *report-stream*) + (write-report-banner "Benchmarks" db-type *report-stream* + (database-name-from-spec spec db-type)) (create-view-from-class 'bench) (benchmark-init) @@ -67,17 +68,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)))))