Raymond Toy pushed to branch issue-240-set-diff-with-hash-table at cmucl / cmucl Commits: c09004a1 by Raymond Toy at 2023-07-26T14:34:09-07:00 Make min-list-length-for-hashtable a defconstant Update name to use `+foo+` convention for constants. - - - - - 1 changed file: - src/code/list.lisp Changes: ===================================== src/code/list.lisp ===================================== @@ -744,8 +744,9 @@ list (cons item list))) -;; The minimum length of a list before we can use a hashtable -(defparameter *min-list-length-for-hashtable* +;; The minimum length of a list before we can use a hashtable. This +;; was determined experimentally. +(defconstant +min-list-length-for-hashtable+ 15) ;; Convert a list to a hashtable. The hashtable does not handle @@ -763,7 +764,7 @@ ;; If the list is too short, the hashtable makes things ;; slower. We also need to balance memory usage. (let ((len (length list))) - (when (< len *min-list-length-for-hashtable*) + (when (< len +min-list-length-for-hashtable+) (return-from list-to-hashtable nil)) (let ((hashtable (make-hash-table :test hash-test :size len))) (dolist (item list) View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/c09004a15331d191b5dcfe71... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/c09004a15331d191b5dcfe71... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)