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

Commit216af5e

Browse files
committed
Make bitmapset.c use 64-bit bitmap words on 64-bit machines.
Using the full width of the CPU's native word size shouldn't costanything in typical cases. When working with large bitmapsets,this halves the number of operations needed for many common BMSoperations. On the right sort of test case, a measurable improvementis obtained.David RowleyDiscussion:https://postgr.es/m/CAKJS1f9EGBd2h-VkXvb=51tf+X46zMX5T8h-KYgXEV_u2zmLUw@mail.gmail.com
1 parent0c23771 commit216af5e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/include/nodes/bitmapset.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,25 @@ struct List;
2727

2828
/*
2929
* Data representation
30+
*
31+
* Larger bitmap word sizes generally give better performance, so long as
32+
* they're not wider than the processor can handle efficiently. We use
33+
* 64-bit words if pointers are that large, else 32-bit words.
3034
*/
35+
#ifSIZEOF_VOID_P >=8
36+
37+
#defineBITS_PER_BITMAPWORD 64
38+
typedefuint64bitmapword;/* must be an unsigned type */
39+
typedefint64signedbitmapword;/* must be the matching signed type */
40+
41+
#else
3142

32-
/* The unit size can be adjusted by changing these three declarations: */
3343
#defineBITS_PER_BITMAPWORD 32
3444
typedefuint32bitmapword;/* must be an unsigned type */
3545
typedefint32signedbitmapword;/* must be the matching signed type */
3646

47+
#endif
48+
3749
typedefstructBitmapset
3850
{
3951
intnwords;/* number of words in array */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp