cvsuser 03/11/09 02:15:25
Modified: src string.c
Log:
speed up repeated concats a lot
Revision Changes Path
1.156 +15 -2 parrot/src/string.c
Index: string.c
===================================================================
RCS file: /cvs/public/parrot/src/string.c,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -w -r1.155 -r1.156
--- string.c 4 Nov 2003 20:05:15 -0000 1.155
+++ string.c 9 Nov 2003 10:15:25 -0000 1.156
@@ -1,7 +1,7 @@
/* string.c
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: string.c,v 1.155 2003/11/04 20:05:15 petergibbs Exp $
+ * $Id: string.c,v 1.156 2003/11/09 10:15:25 leo Exp $
* Overview:
* This is the api definitions for the string subsystem
* Data Structure and Algorithms:
@@ -24,7 +24,20 @@
static const CHARTYPE *string_native_type;
static const CHARTYPE *string_unicode_type;
-#define EXTRA_SIZE 4
+/*
+ * this extra size is in the hope, that some concat ops might
+ * follow in a sequence.
+ *
+ * compiling 3180 chars of a bf programs with bfc gives:
+ *
+ * extra = 4 512 1024
+ * GC runs 2376 74 36
+ * mem copied 210 MB 6 MB 3 MB
+ * time -C 5.2 s 0.3 s 0.2 s
+ */
+
+#define EXTRA_SIZE 512
+
/* work around warning:
* cast discards qualifiers from pointer target type
* s. usage below