mirror of
https://github.com/postgres/postgres.git
synced 2026-01-05 23:38:41 +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:
@@ -21,10 +21,6 @@ typedef char *BITVECP;
|
||||
for(i=0;i<SIGLEN;i++) {\
|
||||
a;\
|
||||
}
|
||||
#define LOOPBIT(a) \
|
||||
for(i=0;i<SIGLENBIT;i++) {\
|
||||
a;\
|
||||
}
|
||||
|
||||
#define GETBYTE(x,i) ( *( (BITVECP)(x) + (int)( (i) / BITS_PER_BYTE ) ) )
|
||||
#define GETBITBYTE(x,i) ( ((char)(x)) >> (i) & 0x01 )
|
||||
|
||||
Reference in New Issue
Block a user