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

Performance improvement in the OP_Column opcode.

FossilOrigin-Name: 4737cadc414c5f6d256fcceacb19d80d66a8c8e7
This commit is contained in:
drh
2016-05-19 16:58:42 +00:00
parent 21690ff7fc
commit 0eda6cd80d
3 changed files with 17 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
C Add\stest\scases\sto\stest\ssome\sfts3/4\sedge\scase\sbehaviour\ssurrounding\sthe\s'*'\scharacter. C Performance\simprovement\sin\sthe\sOP_Column\sopcode.
D 2016-05-19T16:21:30.935 D 2016-05-19T16:58:42.935
F Makefile.in f59e0763ff448719fc1bd25513882b0567286317 F Makefile.in f59e0763ff448719fc1bd25513882b0567286317
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 306d73e854b1a92ea06e5d1e637faa5c44de53c7 F Makefile.msc 306d73e854b1a92ea06e5d1e637faa5c44de53c7
@@ -444,7 +444,7 @@ F src/update.c 4f05ea8cddfa367d045e03589756c02199e8f9bd
F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
F src/util.c 810ec3f22e2d1b62e66c30fe3621ebdedd23584d F src/util.c 810ec3f22e2d1b62e66c30fe3621ebdedd23584d
F src/vacuum.c feb1eabb20987983d9350cad98299b21fa811f52 F src/vacuum.c feb1eabb20987983d9350cad98299b21fa811f52
F src/vdbe.c d9701a72283b84a3a48b285846a9789ae541a1fd F src/vdbe.c ee42e2b8f77c4bf6cf9b29be7b2235b0fc6aeca6
F src/vdbe.h 5591b5add447096e31288b5a0a78ec5d7b5c5170 F src/vdbe.h 5591b5add447096e31288b5a0a78ec5d7b5c5170
F src/vdbeInt.h ddb157974436d87652de7dc641f7191496d9a8cd F src/vdbeInt.h ddb157974436d87652de7dc641f7191496d9a8cd
F src/vdbeapi.c ba85b78fe08dc4a9ce747e62c89a2b4a4547e74c F src/vdbeapi.c ba85b78fe08dc4a9ce747e62c89a2b4a4547e74c
@@ -1489,7 +1489,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 0d7730611be974162d9a064a041957d04d55b6d3 P 1f577e1f08159aeaaf19a7020d9004dd6103d57b
R 75d6e6df9086a2f9f36eca9902564b2b R e89ba2854e43a6ca2d4e88d579ae2259
U dan U drh
Z dcfe2b5ad39143edc6be65e7ccceeb89 Z 6f1f0837aba6646cc9cdae7372a9992d

View File

@@ -1 +1 @@
1f577e1f08159aeaaf19a7020d9004dd6103d57b 4737cadc414c5f6d256fcceacb19d80d66a8c8e7

View File

@@ -2485,14 +2485,15 @@ case OP_Column: {
rc = SQLITE_CORRUPT_BKPT; rc = SQLITE_CORRUPT_BKPT;
goto abort_due_to_error; goto abort_due_to_error;
} }
}else if( offset>0 ){ /*OPTIMIZATION-IF-TRUE*/
/* The following goto is an optimization. It can be omitted and
** everything will still work. But OP_Column is measurably faster
** by skipping the subsequent conditional, which is always true.
*/
zData = pC->aRow;
assert( pC->nHdrParsed<=p2 ); /* Conditional skipped */
goto op_column_read_header;
} }
/* The following goto is an optimization. It can be omitted and
** everything will still work. But OP_Column is measurably faster
** by skipping the subsequent conditional, which is always true.
*/
assert( pC->nHdrParsed<=p2 ); /* Conditional skipped */
goto op_column_read_header;
} }
/* Make sure at least the first p2+1 entries of the header have been /* Make sure at least the first p2+1 entries of the header have been
@@ -2502,7 +2503,6 @@ case OP_Column: {
/* If there is more header available for parsing in the record, try /* If there is more header available for parsing in the record, try
** to extract additional fields up through the p2+1-th field ** to extract additional fields up through the p2+1-th field
*/ */
op_column_read_header:
if( pC->iHdrOffset<aOffset[0] ){ if( pC->iHdrOffset<aOffset[0] ){
/* Make sure zData points to enough of the record to cover the header. */ /* Make sure zData points to enough of the record to cover the header. */
if( pC->aRow==0 ){ if( pC->aRow==0 ){
@@ -2515,11 +2515,11 @@ case OP_Column: {
} }
/* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */
op_column_read_header:
i = pC->nHdrParsed; i = pC->nHdrParsed;
offset64 = aOffset[i]; offset64 = aOffset[i];
zHdr = zData + pC->iHdrOffset; zHdr = zData + pC->iHdrOffset;
zEndHdr = zData + aOffset[0]; zEndHdr = zData + aOffset[0];
assert( i<=p2 && zHdr<zEndHdr );
do{ do{
if( (t = zHdr[0])<0x80 ){ if( (t = zHdr[0])<0x80 ){
zHdr++; zHdr++;