]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Performance improvement in the OP_Column opcode.
authordrh <drh@noemail.net>
Thu, 19 May 2016 16:58:42 +0000 (16:58 +0000)
committerdrh <drh@noemail.net>
Thu, 19 May 2016 16:58:42 +0000 (16:58 +0000)
FossilOrigin-Name: 4737cadc414c5f6d256fcceacb19d80d66a8c8e7

manifest
manifest.uuid
src/vdbe.c

index 30689d702af54e0df04739f214e988306ba4e2e6..d978122ed4bc2918778b618929cfa7945b770461 100644 (file)
--- 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
index c1125dfeb6b516eb8ca6867e0bf577fb217349e2..b52d532ceba38767dabb2bac3f06b9ecfd715645 100644 (file)
@@ -1 +1 @@
-1f577e1f08159aeaaf19a7020d9004dd6103d57b
\ No newline at end of file
+4737cadc414c5f6d256fcceacb19d80d66a8c8e7
\ No newline at end of file
index ed12df9ac69b214049f3a9f9b2a95901b0fb0af4..eecefade249756d7040ef57b2749476cd34e4b12 100644 (file)
@@ -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->iHdrOffset<aOffset[0] ){
       /* Make sure zData points to enough of the record to cover the header. */
       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. */
+    op_column_read_header:
       i = pC->nHdrParsed;
       offset64 = aOffset[i];
       zHdr = zData + pC->iHdrOffset;
       zEndHdr = zData + aOffset[0];
-      assert( i<=p2 && zHdr<zEndHdr );
       do{
         if( (t = zHdr[0])<0x80 ){
           zHdr++;