mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Replace bitwise looping with bytewise looping in hemdistsign and
sizebitvec of tsearch2, as well as identical code in several other contrib modules. This provided about a 20X speedup in building a large tsearch2 index ... didn't try to measure its effects for other operations. Thanks to Stephan Vollmer for providing a test case.
This commit is contained in:
@ -68,11 +68,6 @@ typedef char *BITVECP;
|
||||
a;\
|
||||
}
|
||||
|
||||
#define LOOPBIT(a) \
|
||||
for(i=0;i<SIGLENBIT;i++) {\
|
||||
a;\
|
||||
}
|
||||
|
||||
/* beware of multiple evaluation of arguments to these macros! */
|
||||
#define GETBYTE(x,i) ( *( (BITVECP)(x) + (int)( (i) / BITBYTE ) ) )
|
||||
#define GETBITBYTE(x,i) ( (*((char*)(x)) >> (i)) & 0x01 )
|
||||
|
Reference in New Issue
Block a user