projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r9287: add object selection tests
[clsql.git]
/
tests
/
benchmarks.lisp
diff --git
a/tests/benchmarks.lisp
b/tests/benchmarks.lisp
index 8c3a0ce62403a27c8868dca630e199e09e73e034..3802d5c0880d0dbb4d6c154e896813c54b688b4d 100644
(file)
--- a/
tests/benchmarks.lisp
+++ b/
tests/benchmarks.lisp
@@
-27,7
+27,7
@@
(c :initarg :c
:type float)))
(c :initarg :c
:type float)))
-(defun run-benchmarks (&key (report-stream *standard-output*) (sexp-report-stream nil) (count 1000))
+(defun run-benchmarks (&key (report-stream *standard-output*) (sexp-report-stream nil) (count 1000
0
))
(let ((specs (read-specs))
(*report-stream* report-stream)
(*sexp-report-stream* sexp-report-stream))
(let ((specs (read-specs))
(*report-stream* report-stream)
(*sexp-report-stream* sexp-report-stream))
@@
-42,6
+42,7
@@
(defun do-benchmarks-for-backend (db-type spec count)
(test-connect-to-database db-type spec)
(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)
(write-report-banner "Benchmarks" db-type *report-stream*)
(create-view-from-class 'bench)
@@
-50,7
+51,7
@@
(drop-view-from-class 'bench))
(defun benchmark-init ()
(drop-view-from-class 'bench))
(defun benchmark-init ()
- (dotimes (i 10
0
)
+ (dotimes (i 10)
(execute-command "INSERT INTO BENCH (A,B,C) VALUES (123,'A Medium size string',3.14159)")))
(defun benchmark-selects (n)
(execute-command "INSERT INTO BENCH (A,B,C) VALUES (123,'A Medium size string',3.14159)")))
(defun benchmark-selects (n)
@@
-67,6
+68,10
@@
(time
(dotimes (i n)
(query "SELECT * FROM BENCH" :field-names nil)))
(time
(dotimes (i n)
(query "SELECT * FROM BENCH" :field-names nil)))
+ (format *report-stream* "~&~%*** OBJECT QUERY ***~%")
+ (time
+ (dotimes (i n)
+ (mapcar #'(lambda (ea) (slot-value ea 'address)) (select 'employee-address :flatp t))))
))
))