Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit70868c0

Browse files
committed
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 thissaves a useful amount of repalloc() traffic --- the number of calls occurringduring one set of tests drops from about 6900 to about 3900. The old sizeswere chosen in the late 90's with an eye to machines much smaller thanare common today.
1 parentae65ca3 commit70868c0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎src/backend/lib/stringinfo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $PostgreSQL: pgsql/src/backend/lib/stringinfo.c,v 1.46 2007/05/28 16:43:24 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/lib/stringinfo.c,v 1.47 2007/08/12 20:18:06 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -45,7 +45,7 @@ makeStringInfo(void)
4545
void
4646
initStringInfo(StringInfostr)
4747
{
48-
intsize=256;/* initial default buffer size */
48+
intsize=1024;/* initial default buffer size */
4949

5050
str->data= (char*)palloc(size);
5151
str->maxlen=size;

‎src/backend/parser/scan.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* Portions Copyright (c) 1994, Regents of the University of California
2525
*
2626
* IDENTIFICATION
27-
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.139 2007/01/05 22:19:34 momjian Exp $
27+
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.140 2007/08/12 20:18:06 tgl Exp $
2828
*
2929
*-------------------------------------------------------------------------
3030
*/
@@ -820,7 +820,7 @@ scanner_init(const char *str)
820820
scanbufhandle =yy_scan_buffer(scanbuf, slen +2);
821821

822822
/* initialize literal buffer to a reasonable but expansible size */
823-
literalalloc =128;
823+
literalalloc =1024;
824824
literalbuf = (char *)palloc(literalalloc);
825825
startlit();
826826

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp