1.0.48.22: optimize GENERIC-FUN-INFO
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 24 May 2011 09:47:49 +0000 (09:47 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 24 May 2011 09:47:49 +0000 (09:47 +0000)
  This isn't a huge bottleneck, but it does get called
  enough that going over metatypes twice -- esp. once with
  unoptimized COUNT-IF -- is noticeable in a few places.

src/pcl/boot.lisp
version.lisp-expr

index 17de4a4..c1b3f69 100644 (file)
@@ -2287,9 +2287,16 @@ bootstrapping.
         (values (arg-info-applyp arg-info)
                 metatypes
                 arg-info))
-    (values (length metatypes) applyp metatypes
-            (count-if (lambda (x) (neq x t)) metatypes)
-            arg-info)))
+    (let ((nreq 0)
+          (nkeys 0))
+      (declare (fixnum nreq nkeys))
+      (dolist (x metatypes)
+        (incf nreq)
+        (unless (eq x t)
+          (incf nkeys)))
+      (values nreq applyp metatypes
+              nkeys
+              arg-info))))
 
 (defun early-make-a-method (class qualifiers arglist specializers initargs doc
                             &key slot-name object-class method-class-function
index 69ee89c..f2015d0 100644 (file)
@@ -20,4 +20,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.48.21"
+"1.0.48.22"