summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2007-08-12 20:18:06 +0000
committerTom Lane2007-08-12 20:18:06 +0000
commit408a86b0dc6f1fdd582b64857c2568150afbe4d5 (patch)
tree38136c928a1fa82cc45050bb889224af452252b7
parent7fd4b55b5aab0cc9b99a147921601835234e8c2e (diff)
Increase the initial size of StringInfo buffers to 1024 bytes (from 256);
likewise increase the initial size of the scanner's literal buffer to 1024 (from 128). Instrumentation of the regression tests suggests that this saves a useful amount of repalloc() traffic --- the number of calls occurring during one set of tests drops from about 6900 to about 3900. The old sizes were chosen in the late 90's with an eye to machines much smaller than are common today.
-rw-r--r--src/backend/lib/stringinfo.c2
-rw-r--r--src/backend/parser/scan.l2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/lib/stringinfo.c b/src/backend/lib/stringinfo.c
index 716c6a8b3f..cf8d19977e 100644
--- a/src/backend/lib/stringinfo.c
+++ b/src/backend/lib/stringinfo.c
@@ -45,7 +45,7 @@ makeStringInfo(void)
void
initStringInfo(StringInfo str)
{
- int size = 256; /* initial default buffer size */
+ int size = 1024; /* initial default buffer size */
str->data = (char *) palloc(size);
str->maxlen = size;
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index ae775ebab9..2e16215856 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -820,7 +820,7 @@ scanner_init(const char *str)
scanbufhandle = yy_scan_buffer(scanbuf, slen + 2);
/* initialize literal buffer to a reasonable but expansible size */
- literalalloc = 128;
+ literalalloc = 1024;
literalbuf = (char *) palloc(literalalloc);
startlit();