[Ecls-list] [PATCH] Don't do unnecessary work: clrhash on empty hash

Erik Huelsmann ehuels at gmail.com
Mon Aug 4 17:10:36 UTC 2008


Well,  it worked miracles for SBCL (reducing build time by 10%). I
have no idea about the effect it has on ECL performance, but the patch
below adds the equivalent check as recently implemented on SBCL for
ECL.

Hope it has value.


Bye,


Erik.


Index: hash.d
===================================================================
RCS file: /cvsroot/ecls/ecl/src/c/hash.d,v
retrieving revision 1.56
diff -u -r1.56 hash.d
--- hash.d	30 May 2008 23:52:32 -0000	1.56
+++ hash.d	4 Aug 2008 16:59:23 -0000
@@ -521,6 +521,9 @@
 	cl_index i;

 	assert_type_hash_table(ht);
+
+      /* Don't do any unnecessary cleaning/locking */
+      if (ht->hash.entries == 0) @(return ht);
 	HASH_TABLE_LOCK(ht);
 	for(i = 0; i < ht->hash.size; i++) {
 		ht->hash.data[i].key = OBJNULL;




More information about the ecl-devel mailing list