diff options
author | drh <> | 2022-02-27 18:54:33 +0000 |
---|---|---|
committer | drh <> | 2022-02-27 18:54:33 +0000 |
commit | a1e951fa48050ac346e49cb74a923f6309fedf80 (patch) | |
tree | 3f00a7392b6592f10477d6e364643ec97ed476f5 /src/vdbeaux.c | |
parent | a0318fd7b4fbedbce74f133fb0f84ff4a19ea075 (diff) | |
download | sqlite-a1e951fa48050ac346e49cb74a923f6309fedf80.tar.gz sqlite-a1e951fa48050ac346e49cb74a923f6309fedf80.zip |
Bypass a single branch in vdbeRecordCompareString() in the common case, for
a performance increase of over 600K CPU cycles.
FossilOrigin-Name: 36f0f07e505dfb38c61d3b4d5b947013c8793e6796fe690e53864479b9276abb
Diffstat (limited to 'src/vdbeaux.c')
-rw-r--r-- | src/vdbeaux.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 35044127a..be9cebd51 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -4746,11 +4746,15 @@ static int vdbeRecordCompareString( assert( pPKey2->aMem[0].flags & MEM_Str ); vdbeAssertFieldCountWithinLimits(nKey1, pKey1, pPKey2->pKeyInfo); - serial_type = (u8)(aKey1[1]); - if( serial_type >= 0x80 ){ - sqlite3GetVarint32(&aKey1[1], (u32*)&serial_type); - } + serial_type = (signed char)(aKey1[1]); + +vrcs_restart: if( serial_type<12 ){ + if( serial_type<0 ){ + sqlite3GetVarint32(&aKey1[1], (u32*)&serial_type); + if( serial_type>=12 ) goto vrcs_restart; + assert( CORRUPT_DB ); + } res = pPKey2->r1; /* (pKey1/nKey1) is a number or a null */ }else if( !(serial_type & 0x01) ){ res = pPKey2->r2; /* (pKey1/nKey1) is a blob */ |