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

Commit28d750c

Browse files
committed
Reorder FmgrBuiltin members, saving 25% in size.
That's worth it, as fmgr_builtins is frequently accessed, and asfmgr_builtins is one of the biggest constant variables in a backend.On most 64bit systems this will change the size of the struct from32byte to 24bytes. While that could make indexing into the arraymarginally more expensive, the higher cache hit ratio is worth more,especially because these days fmgr_builtins isn't searched with abinary search anymore (c.f.212e6f3).Discussion:https://postgr.es/m/20181016201145.aa2dfeq54rhqzron@alap3.anarazel.de
1 parent68fc227 commit28d750c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/backend/utils/Gen_fmgrtab.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
foreachmy$s (sort {$a->{oid}<=>$b->{oid} }@fmgr)
231231
{
232232
print$tfh
233-
" {$s->{oid},\"$s->{prosrc}\",$s->{nargs},$bmap{$s->{strict}},$bmap{$s->{retset}},$s->{prosrc} }";
233+
" {$s->{oid},$s->{nargs},$bmap{$s->{strict}},$bmap{$s->{retset}},\"$s->{prosrc}\",$s->{prosrc} }";
234234

235235
$fmgr_builtin_oid_index[$s->{oid} ] =$fmgr_count++;
236236

‎src/include/utils/fmgrtab.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
typedefstruct
2626
{
2727
Oidfoid;/* OID of the function */
28-
constchar*funcName;/* C name of the function */
2928
shortnargs;/* 0..FUNC_MAX_ARGS, or -1 if variable count */
3029
boolstrict;/* T if function is "strict" */
3130
boolretset;/* T if function returns a set */
31+
constchar*funcName;/* C name of the function */
3232
PGFunctionfunc;/* pointer to compiled function */
3333
}FmgrBuiltin;
3434

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp