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

Commit12d17de

Browse files
committed
Use MemSet() rather than a loop to do blank-padding on PS_USE_CLOBBER_ARGV
machines. I have just been observing some scenarios where set_ps_displayaccounts for more than 10% of the backend CPU, and this loop has to bethe reason.
1 parentdb66761 commit12d17de

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎src/backend/utils/misc/ps_status.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* to contain some useful information. Mechanism differs wildly across
66
* platforms.
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/ps_status.c,v 1.11 2001/11/06 01:15:29 tgl Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/ps_status.c,v 1.12 2001/12/2115:22:09 tgl Exp $
99
*
1010
* Copyright 2000 by PostgreSQL Global Development Group
1111
* various details abducted from various places
@@ -265,13 +265,11 @@ set_ps_display(const char *activity)
265265

266266
#ifdefPS_USE_CLOBBER_ARGV
267267
{
268-
char*cp;
268+
intbuflen;
269269

270270
/* pad unused memory */
271-
for (cp=ps_buffer+strlen(ps_buffer);
272-
cp<ps_buffer+ps_buffer_size;
273-
cp++)
274-
*cp=PS_PADDING;
271+
buflen=strlen(ps_buffer);
272+
MemSet(ps_buffer+buflen,PS_PADDING,ps_buffer_size-buflen);
275273
}
276274
#endif/* PS_USE_CLOBBER_ARGV */
277275
#endif/* not PS_USE_NONE */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp