Raymond Toy pushed to branch issue-240-subsetp-with-hash-table at cmucl / cmucl

Commits:

4 changed files:

Changes:

  • src/code/lispinit.lisp
    ... ... @@ -347,9 +347,6 @@
    347 347
       #+gengc (setf conditions::*handler-clusters* nil)
    
    348 348
       (setq intl::*default-domain* "cmucl")
    
    349 349
       (setq intl::*locale* "C")
    
    350
    -  ;; During init, we can't use hashtables to speed up the set
    
    351
    -  ;; functions.  In particular, subsetp is used in type-init.
    
    352
    -  (setq lisp::*allow-hashtable-for-set-functions* nil)
    
    353 350
     
    
    354 351
       ;; Many top-level forms call INFO, (SETF INFO).
    
    355 352
       (print-and-call c::globaldb-init)
    

  • src/code/list.lisp
    ... ... @@ -989,8 +989,6 @@
    989 989
     	      (rplacd splicex (cdr x)))
    
    990 990
     	  (setq splicex x)))))
    
    991 991
     
    
    992
    -(defvar *allow-hashtable-for-set-functions* t)
    
    993
    -
    
    994 992
     (declaim (start-block shorter-list-to-hashtable subsetp))
    
    995 993
     
    
    996 994
     (defun shorter-list-to-hashtable (list1 list2 key test test-not)
    
    ... ... @@ -1013,7 +1011,7 @@
    1013 1011
                  (lst2 list2 (cdr lst2)))
    
    1014 1012
                 ((or (null lst1) (null lst2))
    
    1015 1013
                  (values len (if (null lst1) list1 list2))))
    
    1016
    -      (when (< min-length *min-list-length-for-hashtable*)
    
    1014
    +      (when (< min-length kernel::*min-list-length-for-subsetp-hashtable*)
    
    1017 1015
             (return-from shorter-list-to-hashtable nil))
    
    1018 1016
           (let ((hashtable (make-hash-table :test hash-test :size min-length)))
    
    1019 1017
             (dolist (item shorter-list)
    
    ... ... @@ -1031,7 +1029,7 @@
    1031 1029
       ;; take care to disable this for the kernel.core.  SAVE will set
    
    1032 1030
       ;; this to true when it's safe to use hash tables for SUBSETP.
    
    1033 1031
       (multiple-value-bind (hashtable shorter-list)
    
    1034
    -      (when *allow-hashtable-for-set-functions*
    
    1032
    +      (when t
    
    1035 1033
             (shorter-list-to-hashtable list1 list2 key test test-not))
    
    1036 1034
         (cond (hashtable
    
    1037 1035
                (cond ((eq shorter-list list1)
    

  • src/code/save.lisp
    ... ... @@ -320,8 +320,6 @@
    320 320
     	     (intl::setlocale)
    
    321 321
     	     (ext::process-command-strings process-command-line)
    
    322 322
     	     (setf *editor-lisp-p* nil)
    
    323
    -	     ;; Allow using hashtables to speed up the set functions
    
    324
    -	     (setf lisp::*allow-hashtable-for-set-functions* t)
    
    325 323
     	     (macrolet ((find-switch (name)
    
    326 324
     			  `(find ,name *command-line-switches*
    
    327 325
     				 :key #'cmd-switch-name
    

  • src/code/type.lisp
    ... ... @@ -377,6 +377,14 @@
    377 377
     (cold-load-init (setq *use-implementation-types* t))
    
    378 378
     (declaim (type boolean *use-implementation-types*))
    
    379 379
     
    
    380
    +(defvar *min-list-length-for-subsetp-hashtable* 150
    
    381
    +  "The minimum length of either list argument for subsetp where a
    
    382
    +  hashtable is used to speed up processing instead of using a basic
    
    383
    +  list implementation.  This value was determined by experimentation.")
    
    384
    +
    
    385
    +(cold-load-init (setq *min-list-length-for-subsetp-hashtable* 150))
    
    386
    +(declaim (type fixnum *min-list-length-for-subsetp-hashtable*))
    
    387
    +
    
    380 388
     ;;; DELEGATE-COMPLEX-{SUBTYPEP-ARG2,INTERSECTION}  --  Interface
    
    381 389
     ;;;
    
    382 390
     ;;;    These functions are used as method for types which need a complex