[svn:parrot] r48950 - trunk/src/string

plobsing at svn.parrot.org plobsing at svn.parrot.org
Sun Sep 12 01:08:04 UTC 2010


Author: plobsing
Date: Sun Sep 12 01:08:04 2010
New Revision: 48950
URL: https://trac.parrot.org/parrot/changeset/48950

Log:
pre-size the constant string hash. gets ~2% performance improvement on parrot startup.

Modified:
   trunk/src/string/api.c

Modified: trunk/src/string/api.c
==============================================================================
--- trunk/src/string/api.c	Sun Sep 12 01:05:04 2010	(r48949)
+++ trunk/src/string/api.c	Sun Sep 12 01:08:04 2010	(r48950)
@@ -133,7 +133,10 @@
     }
 
     /* Set up the cstring cache, then load the basic encodings */
-    const_cstring_hash          = parrot_new_cstring_hash(interp);
+    const_cstring_hash          = parrot_create_hash_sized(interp,
+                                        enum_type_PMC,
+                                        Hash_key_type_cstring,
+                                        n_parrot_cstrings);
     interp->const_cstring_hash  = const_cstring_hash;
     Parrot_encodings_init(interp);
 


More information about the parrot-commits mailing list