Commit f15977bd authored by Raymond Toy's avatar Raymond Toy
Browse files

Store the results in our directory instead of /var/tmp

Adjust where the reports are stored when running the benchmarks and
where the reports are read from.

Instead of /var/tmp, use cl-bench/results.  This will make it easier
to find these files in CI.
parent 22b8fc9f
Pipeline #1800 passed with stage
in 11 minutes and 43 seconds
...@@ -14,18 +14,28 @@ ...@@ -14,18 +14,28 @@
(in-package :cl-user) (in-package :cl-user)
(defvar *benchmark-file-directory*
(merge-pathnames (make-pathname :directory '(:relative "results"))
(make-pathname :directory (pathname-directory *load-truename*)))
"Directory where the benchmark report file is stored")
(defconstant +implementation+ (defconstant +implementation+
(concatenate 'string (concatenate 'string
(lisp-implementation-type) " " (lisp-implementation-type) " "
(lisp-implementation-version))) (lisp-implementation-version)))
(defun bench-analysis () (defun bench-analysis ()
(let (data implementations benchmarks) (let ((benchmark-path (concatenate 'string
(dolist (f (directory "/var/tmp/CL-benchmark*.*")) (namestring *benchmark-file-directory*)
"CL-benchmark*.*"))
data implementations benchmarks)
(dolist (f (directory benchmark-path))
(format t "*** f = ~A~%" f)
(ignore-errors (ignore-errors
(with-open-file (f f :direction :input) (with-open-file (f f :direction :input)
(let ((*read-eval* nil)) (let ((*read-eval* nil))
(push (read f) data))))) (push (read f) data)))))
(format t "*** data = ~A~%" data)
(setq implementations (delete +implementation+ (mapcar #'car data) :test #'string=)) (setq implementations (delete +implementation+ (mapcar #'car data) :test #'string=))
(setq benchmarks (reverse (mapcar #'first (cdr (first data))))) (setq benchmarks (reverse (mapcar #'first (cdr (first data)))))
(format t "~25a~10@a" "Benchmark" "Reference") (format t "~25a~10@a" "Benchmark" "Reference")
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
(defvar *benchmarks* '()) (defvar *benchmarks* '())
(defvar *benchmark-results* '()) (defvar *benchmark-results* '())
(defvar *benchmark-file-directory*
(merge-pathnames (make-pathname :directory '(:relative "results"))
(make-pathname :directory (pathname-directory *load-truename*)))
"Directory where the benchmark report file is stored")
(defvar +implementation+ (defvar +implementation+
(concatenate 'string (concatenate 'string
...@@ -117,11 +121,14 @@ ...@@ -117,11 +121,14 @@
(defun benchmark-report-file () (defun benchmark-report-file ()
(ensure-directories-exist *benchmark-file-directory*)
(multiple-value-bind (second minute hour date month year) (multiple-value-bind (second minute hour date month year)
(get-decoded-time) (get-decoded-time)
(declare (ignore second)) (declare (ignore second))
;; Should we use pathnames directly instead of creating a string
;; naming the file?
(format nil "~aCL-benchmark-~d~2,'0d~2,'0dT~2,'0d~2,'0d" (format nil "~aCL-benchmark-~d~2,'0d~2,'0dT~2,'0d~2,'0d"
#+win32 "" #-win32 "/var/tmp/" *benchmark-file-directory*
year month date hour minute))) year month date hour minute)))
;; grr, CLISP doesn't implement ~<..~:> ;; grr, CLISP doesn't implement ~<..~:>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment