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

Improvements to comments. Minor changes to code in the hot path of

OP_Column - with the hope of get a few cycles of performance improvement.

FossilOrigin-Name: ca093103437f141caa3eb11539c6eb7b4dd65175
This commit is contained in:
drh
2012-03-28 13:41:10 +00:00
parent 3c888b7d1b
commit dda5c08bf6
3 changed files with 20 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
C Test\scases\sfor\slength()\sof\sa\slarge\sblob\sin\san\saggregate\squery.
D 2012-03-28T02:51:51.807
C Improvements\sto\scomments.\s\sMinor\schanges\sto\scode\sin\sthe\shot\spath\sof\nOP_Column\s-\swith\sthe\shope\sof\sget\sa\sfew\scycles\sof\sperformance\simprovement.
D 2012-03-28T13:41:10.884
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -240,7 +240,7 @@ F src/update.c d3076782c887c10e882996550345da9c4c9f9dea
F src/utf.c 890c67dcfcc7a74623c95baac7535aadfe265e84
F src/util.c 4f6cfad661b2e3454b0cdd5b1b9d39a54942d0e3
F src/vacuum.c bfd53f9bd20a8fdb70b0fa8e77182b866875c0d8
F src/vdbe.c b91a9135fa4ecd73805cfda7b051dbcc155a0fb8
F src/vdbe.c 807532457744a264d19e929b2075dbec90d2a36d
F src/vdbe.h 18f581cac1f4339ec3299f3e0cc6e11aec654cdb
F src/vdbeInt.h 6ff4180a05683566a8835d12f7ec504b22932c82
F src/vdbeapi.c 3662b6a468a2a4605a15dfab313baa6dff81ad91
@@ -993,7 +993,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P bc18215a8a660442db6ddeeda4a88df0acffe0f7
R 3ecaca7bd152423dde5d0467891373c7
P d095fa4bfabd765c8e935ed227a334161097dd34
R 78ef170f6dad0ba0a0f49e941cd533cb
U drh
Z c57e0152e24243ecb61f7c7f2f11b01f
Z 6f108b9c2dd42e83ba81e7472cbc6ad3

View File

@@ -1 +1 @@
d095fa4bfabd765c8e935ed227a334161097dd34
ca093103437f141caa3eb11539c6eb7b4dd65175

View File

@@ -2128,10 +2128,10 @@ case OP_NotNull: { /* same as TK_NOTNULL, jump, in1 */
** The first OP_Column against a pseudo-table after the value of the content
** register has changed should have this bit set.
**
** If the OPFLAG_LENGTHARG bit is set on P5 then the result is guaranteed
** to only be used as the argument of a length() or typeof() function and
** so loading of large blobs and strings can be skipped - all that is necessary
** is that the size and type information be set.
** If the OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG bits are set on P5 when
** the result is guaranteed to only be used as the argument of a length()
** or typeof() function, respectively. The loading of large blobs can be
** skipped for length() and all content loading can be skipped for typeof().
*/
case OP_Column: {
u32 payloadSize; /* Number of bytes in the record */
@@ -2272,7 +2272,7 @@ case OP_Column: {
pC->aRow = 0;
}
}
/* The following assert is true in all cases accept when
/* The following assert is true in all cases except when
** the database file has been corrupted externally.
** assert( zRec!=0 || avail>=payloadSize || avail>=9 ); */
szHdr = getVarint32((u8*)zData, offset);
@@ -2347,11 +2347,11 @@ case OP_Column: {
break;
}
}else{
/* If i is less that nField, then there are less fields in this
/* If i is less that nField, then there are fewer fields in this
** record than SetNumColumns indicated there are columns in the
** table. Set the offset for any extra columns not present in
** the record to 0. This tells code below to store a NULL
** instead of deserializing a value from the record.
** the record to 0. This tells code below to store the default value
** for the column instead of deserializing a value from the record.
*/
aOffset[i] = 0;
}
@@ -2384,12 +2384,13 @@ case OP_Column: {
VdbeMemRelease(pDest);
sqlite3VdbeSerialGet((u8 *)&zRec[aOffset[p2]], aType[p2], pDest);
}else{
len = sqlite3VdbeSerialTypeLen(aType[p2]);
t = aType[p2];
len = sqlite3VdbeSerialTypeLen(t);
if( (pOp->p5 & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))!=0
&& (((t = aType[p2])>=12 && (t&1)==0) || (pOp->p5 & OPFLAG_TYPEOFARG)!=0)
&& ((t>=12 && (t&1)==0) || (pOp->p5 & OPFLAG_TYPEOFARG)!=0)
){
/* Content is irrelevant for the typeof() function and for
** the length(x) function is x is a blob. So we might as well use
** the length(X) function if X is a blob. So we might as well use
** bogus content rather than reading content from disk. NULL works
** for text and blob and whatever is in the payloadSize64 variable
** will work for everything else. */
@@ -2403,7 +2404,7 @@ case OP_Column: {
}
zData = sMem.z;
}
sqlite3VdbeSerialGet((u8*)zData, aType[p2], pDest);
sqlite3VdbeSerialGet((u8*)zData, t, pDest);
}
pDest->enc = encoding;
}else{