1
0
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:
drh
2023-02-28 12:31:40 +00:00
parent b211a4b391
commit 485a92cbb9
3 changed files with 20 additions and 16 deletions

View File

@@ -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++;