From 7d93a0147a14e14d6964bf93ba11cf494b9d49fd Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Thu, 2 Nov 2023 17:05:26 +0100 Subject: Share hash table test structs This saves several words in the hash table object at the cost of an indirection at runtime. This seems to be a gain in overall performance. FIXME: We cache hash test objects in a rather clumsy way. A better solution is sought. * src/lisp.h (struct Lisp_Hash_Table): Use a pointer to the test struct. All references adapted. * src/alloc.c (garbage_collect): * src/fns.c (struct hash_table_user_test, hash_table_user_tests) (mark_fns, get_hash_table_user_test): New state for caching test structs, and functions managing it. --- src/profiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/profiler.c') diff --git a/src/profiler.c b/src/profiler.c index 06ffecf41e3..5a6a8b48f6b 100644 --- a/src/profiler.c +++ b/src/profiler.c @@ -563,7 +563,7 @@ export_log (struct profiler_log *plog) which is more discriminating than the `function-equal' used by the log but close enough, and will never confuse two distinct keys in the log. */ - Lisp_Object h = make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE, + Lisp_Object h = make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None, false); for (int i = 0; i < log->size; i++) { -- cgit v1.2.3-70-g09d2