Raymond Toy pushed to branch rtoy-issue-87-add-cl-bench at cmucl / cmucl
Commits:
-
f15977bd
by Raymond Toy at 2020-09-04T11:03:27-07:00
2 changed files:
Changes:
... | ... | @@ -14,18 +14,28 @@ |
14 | 14 |
|
15 | 15 |
(in-package :cl-user)
|
16 | 16 |
|
17 |
+(defvar *benchmark-file-directory*
|
|
18 |
+ (merge-pathnames (make-pathname :directory '(:relative "results"))
|
|
19 |
+ (make-pathname :directory (pathname-directory *load-truename*)))
|
|
20 |
+ "Directory where the benchmark report file is stored")
|
|
21 |
+ |
|
17 | 22 |
(defconstant +implementation+
|
18 | 23 |
(concatenate 'string
|
19 | 24 |
(lisp-implementation-type) " "
|
20 | 25 |
(lisp-implementation-version)))
|
21 | 26 |
|
22 | 27 |
(defun bench-analysis ()
|
23 |
- (let (data implementations benchmarks)
|
|
24 |
- (dolist (f (directory "/var/tmp/CL-benchmark*.*"))
|
|
28 |
+ (let ((benchmark-path (concatenate 'string
|
|
29 |
+ (namestring *benchmark-file-directory*)
|
|
30 |
+ "CL-benchmark*.*"))
|
|
31 |
+ data implementations benchmarks)
|
|
32 |
+ (dolist (f (directory benchmark-path))
|
|
33 |
+ (format t "*** f = ~A~%" f)
|
|
25 | 34 |
(ignore-errors
|
26 | 35 |
(with-open-file (f f :direction :input)
|
27 | 36 |
(let ((*read-eval* nil))
|
28 | 37 |
(push (read f) data)))))
|
38 |
+ (format t "*** data = ~A~%" data)
|
|
29 | 39 |
(setq implementations (delete +implementation+ (mapcar #'car data) :test #'string=))
|
30 | 40 |
(setq benchmarks (reverse (mapcar #'first (cdr (first data)))))
|
31 | 41 |
(format t "~25a~10@a" "Benchmark" "Reference")
|
... | ... | @@ -21,6 +21,10 @@ |
21 | 21 |
|
22 | 22 |
(defvar *benchmarks* '())
|
23 | 23 |
(defvar *benchmark-results* '())
|
24 |
+(defvar *benchmark-file-directory*
|
|
25 |
+ (merge-pathnames (make-pathname :directory '(:relative "results"))
|
|
26 |
+ (make-pathname :directory (pathname-directory *load-truename*)))
|
|
27 |
+ "Directory where the benchmark report file is stored")
|
|
24 | 28 |
|
25 | 29 |
(defvar +implementation+
|
26 | 30 |
(concatenate 'string
|
... | ... | @@ -117,11 +121,14 @@ |
117 | 121 |
|
118 | 122 |
|
119 | 123 |
(defun benchmark-report-file ()
|
124 |
+ (ensure-directories-exist *benchmark-file-directory*)
|
|
120 | 125 |
(multiple-value-bind (second minute hour date month year)
|
121 | 126 |
(get-decoded-time)
|
122 | 127 |
(declare (ignore second))
|
128 |
+ ;; Should we use pathnames directly instead of creating a string
|
|
129 |
+ ;; naming the file?
|
|
123 | 130 |
(format nil "~aCL-benchmark-~d~2,'0d~2,'0dT~2,'0d~2,'0d"
|
124 |
- #+win32 "" #-win32 "/var/tmp/"
|
|
131 |
+ *benchmark-file-directory*
|
|
125 | 132 |
year month date hour minute)))
|
126 | 133 |
|
127 | 134 |
;; grr, CLISP doesn't implement ~<..~:>
|