1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

The putVarint32() macro does not optimize well. So expand it into in-line

code in places were performance is an issue.

FossilOrigin-Name: 390c239e53cf936a97b268dce8171f0b17050542ae64735ca8ef375fec2c9544
This commit is contained in:
drh
2022-04-01 21:01:37 +00:00
parent 759e507ce5
commit b47b1f67dc
4 changed files with 23 additions and 11 deletions

View File

@@ -3374,14 +3374,22 @@ case OP_MakeRecord: {
zPayload = zHdr + nHdr;
/* Write the record */
zHdr += putVarint32(zHdr, nHdr);
if( nHdr<0x80 ){
*(zHdr++) = nHdr;
}else{
zHdr += sqlite3PutVarint(zHdr,nHdr);
}
assert( pData0<=pLast );
pRec = pData0;
while( 1 /*exit-by-break*/ ){
serial_type = pRec->uTemp;
/* EVIDENCE-OF: R-06529-47362 Following the size varint are one or more
** additional varints, one per column. */
zHdr += putVarint32(zHdr, serial_type); /* serial type */
if( serial_type<0x80 ){
*(zHdr++) = serial_type;
}else{
zHdr += sqlite3PutVarint(zHdr, serial_type);
}
/* EVIDENCE-OF: R-64536-51728 The values for each column in the record
** immediately follow the header. */
zPayload += sqlite3VdbeSerialPut(zPayload, pRec, serial_type); /* content */