mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Performance optimization in the varint decoder for the cell parser.
FossilOrigin-Name: b2b91c7cb40f1efe800059614e34823411016a3ece3f988e1574aecadd4c3114
This commit is contained in:
20
src/btree.c
20
src/btree.c
@@ -1231,27 +1231,31 @@ static void btreeParseCellPtr(
|
||||
iKey = *pIter;
|
||||
if( iKey>=0x80 ){
|
||||
u8 x;
|
||||
iKey = ((iKey&0x7f)<<7) | ((x = *++pIter) & 0x7f);
|
||||
iKey = (iKey<<7) ^ (x = *++pIter);
|
||||
if( x>=0x80 ){
|
||||
iKey = (iKey<<7) | ((x =*++pIter) & 0x7f);
|
||||
iKey = (iKey<<7) ^ (x = *++pIter);
|
||||
if( x>=0x80 ){
|
||||
iKey = (iKey<<7) | ((x = *++pIter) & 0x7f);
|
||||
iKey = (iKey<<7) ^ 0x10204000 ^ (x = *++pIter);
|
||||
if( x>=0x80 ){
|
||||
iKey = (iKey<<7) | ((x = *++pIter) & 0x7f);
|
||||
iKey = (iKey<<7) ^ 0x4000 ^ (x = *++pIter);
|
||||
if( x>=0x80 ){
|
||||
iKey = (iKey<<7) | ((x = *++pIter) & 0x7f);
|
||||
iKey = (iKey<<7) ^ 0x4000 ^ (x = *++pIter);
|
||||
if( x>=0x80 ){
|
||||
iKey = (iKey<<7) | ((x = *++pIter) & 0x7f);
|
||||
iKey = (iKey<<7) ^ 0x4000 ^ (x = *++pIter);
|
||||
if( x>=0x80 ){
|
||||
iKey = (iKey<<7) | ((x = *++pIter) & 0x7f);
|
||||
iKey = (iKey<<7) ^ 0x4000 ^ (x = *++pIter);
|
||||
if( x>=0x80 ){
|
||||
iKey = (iKey<<8) | (*++pIter);
|
||||
iKey = (iKey<<8) ^ 0x8000 ^ (*++pIter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
iKey ^= 0x204000;
|
||||
}
|
||||
}else{
|
||||
iKey ^= 0x4000;
|
||||
}
|
||||
}
|
||||
pIter++;
|
||||
|
Reference in New Issue
Block a user