From: drh Date: Thu, 19 May 2016 16:58:42 +0000 (+0000) Subject: Performance improvement in the OP_Column opcode. X-Git-Tag: version-3.14.0~162 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0eda6cd80d27e97ed9b87ed1e373acfe7cd65007;p=thirdparty%2Fsqlite.git Performance improvement in the OP_Column opcode. FossilOrigin-Name: 4737cadc414c5f6d256fcceacb19d80d66a8c8e7 --- diff --git a/manifest b/manifest index 30689d702a..d978122ed4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\stest\scases\sto\stest\ssome\sfts3/4\sedge\scase\sbehaviour\ssurrounding\sthe\s'*'\scharacter. -D 2016-05-19T16:21:30.935 +C Performance\simprovement\sin\sthe\sOP_Column\sopcode. +D 2016-05-19T16:58:42.935 F Makefile.in f59e0763ff448719fc1bd25513882b0567286317 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 306d73e854b1a92ea06e5d1e637faa5c44de53c7 @@ -444,7 +444,7 @@ F src/update.c 4f05ea8cddfa367d045e03589756c02199e8f9bd F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c F src/util.c 810ec3f22e2d1b62e66c30fe3621ebdedd23584d F src/vacuum.c feb1eabb20987983d9350cad98299b21fa811f52 -F src/vdbe.c d9701a72283b84a3a48b285846a9789ae541a1fd +F src/vdbe.c ee42e2b8f77c4bf6cf9b29be7b2235b0fc6aeca6 F src/vdbe.h 5591b5add447096e31288b5a0a78ec5d7b5c5170 F src/vdbeInt.h ddb157974436d87652de7dc641f7191496d9a8cd F src/vdbeapi.c ba85b78fe08dc4a9ce747e62c89a2b4a4547e74c @@ -1489,7 +1489,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 0d7730611be974162d9a064a041957d04d55b6d3 -R 75d6e6df9086a2f9f36eca9902564b2b -U dan -Z dcfe2b5ad39143edc6be65e7ccceeb89 +P 1f577e1f08159aeaaf19a7020d9004dd6103d57b +R e89ba2854e43a6ca2d4e88d579ae2259 +U drh +Z 6f1f0837aba6646cc9cdae7372a9992d diff --git a/manifest.uuid b/manifest.uuid index c1125dfeb6..b52d532ceb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1f577e1f08159aeaaf19a7020d9004dd6103d57b \ No newline at end of file +4737cadc414c5f6d256fcceacb19d80d66a8c8e7 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index ed12df9ac6..eecefade24 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -2485,14 +2485,15 @@ case OP_Column: { rc = SQLITE_CORRUPT_BKPT; 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 @@ -2502,7 +2503,6 @@ case OP_Column: { /* If there is more header available for parsing in the record, try ** to extract additional fields up through the p2+1-th field */ - op_column_read_header: if( pC->iHdrOffsetaRow==0 ){ @@ -2515,11 +2515,11 @@ case OP_Column: { } /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ + op_column_read_header: i = pC->nHdrParsed; offset64 = aOffset[i]; zHdr = zData + pC->iHdrOffset; zEndHdr = zData + aOffset[0]; - assert( i<=p2 && zHdr