armedbear / abcl

Armed Bear Common Lisp <git+https://github.com/armedbear/abcl/> <--> <svn+https://abcl.org/svn> Bridge
https://abcl.org#rdfs:seeAlso<https://gitlab.common-lisp.net/abcl/abcl>
Other
291 stars 29 forks source link

clos: restore some of the speed of the generic function cache #598

Closed easye closed 1 year ago

easye commented 1 year ago

Addresses https://github.com/armedbear/abcl/issues/587

From https://github.com/armedbear/abcl/issues/587#issuecomment-1597840833.

--

https://github.com/PiotrWasik found that abcl-1.9.1 had around an order of magnitude slowdown from abcl-1.8.0 with the subsequent code, which is included here for completeness.

(load "c:/Users/piotr/quicklisp/setup.lisp") (funcall (read-from-string "ql:quickload") :cl-fad) (funcall (read-from-string "ql:quickload") :cl-ppcre) (funcall (read-from-string "ql:quickload") :arnesi) |#

(asdf:load-system :cl-fad) (asdf:load-system :cl-ppcre) (asdf:load-system :arnesi)

(defun load-all-source-files () (let (content-of-files) (cl-fad:walk-directory

+nil

 "c:/dev/usr/abcl-bin-1.9.1/abcl-1.9.1-sources/"
 #p"~/work/abcl/src"
 (lambda (filename)
   (push (arnesi:read-string-from-file filename) content-of-files)))
content-of-files))

(defun show-runtime-10 () (let ((content-of-files (load-all-source-files)) (start-time (get-internal-real-time))) (dolist (content content-of-files) (cl-ppcre:do-scans (match-start match-end rs re "\n" content))) (float (/ (- (get-internal-real-time) start-time) internal-time-units-per-second))))

;; (princ "test Version 10") ;; (princ (multiple-value-list (lisp-implementation-version)))

(defun report () (arnesi:write-string-to-file (format nil "(~s ~s ~s)~%" (get-universal-time) (first ext:command-line-argument-list) (show-runtime-10)) "c:/dev/home/performance-log.txt" :if-exists :append :if-does-not-exist :create))

(report)

Without patching declaim

1.426

Patched

1.628

|#