emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/hash-table-perf e6defe82569 27/35: Change default hash table siz


From: Mattias Engdegård
Subject: scratch/hash-table-perf e6defe82569 27/35: Change default hash table size to 8 (from 65)
Date: Thu, 4 Jan 2024 10:56:43 -0500 (EST)

branch: scratch/hash-table-perf
commit e6defe825693bf9090151195e85f6b388f70fe64
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Change default hash table size to 8 (from 65)
    
    Most tables are small so 65 was much too large.
    
    * src/lisp.h (DEFAULT_HASH_SIZE): New value.
---
 src/fns.c  | 3 ++-
 src/lisp.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/fns.c b/src/fns.c
index 1a73353b70d..3bf9146f9da 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -5386,7 +5386,8 @@ keys.  Default is `eql'.  Predefined are the tests `eq', 
`eql', and
 `define-hash-table-test'.
 
 :size SIZE -- A hint as to how many elements will be put in the table.
-Default is 65.
+The table will always grow as needed; this argument may help performance
+slightly if the size is known in advance but is never required.
 
 :weakness WEAK -- WEAK must be one of nil, t, `key', `value',
 `key-or-value', or `key-and-value'.  If WEAK is not nil, the table
diff --git a/src/lisp.h b/src/lisp.h
index 00d03ccb9e5..083733429ed 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2563,7 +2563,7 @@ void hash_table_thaw (Lisp_Object hash_table);
 
 /* Default size for hash tables if not specified.  */
 
-enum DEFAULT_HASH_SIZE { DEFAULT_HASH_SIZE = 65 };
+enum DEFAULT_HASH_SIZE { DEFAULT_HASH_SIZE = 8 };
 
 /* Combine two integers X and Y for hashing.  The result might exceed
    INTMASK.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]