Index: src/vdbe.c ================================================================== --- src/vdbe.c +++ src/vdbe.c @@ -560,11 +560,11 @@ */ int sqlite3VdbeExec( Vdbe *p /* The VDBE */ ){ Op *aOp = p->aOp; /* Copy of p->aOp */ - Op *pOp = aOp; /* Current operation */ + Op *pOp; /* Current operation */ #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE) Op *pOrigOp; /* Value of pOp at the top of the loop */ #endif #ifdef SQLITE_DEBUG int nExtraDelete = 0; /* Verifies FORDELETE and AUXDELETE flags */ @@ -595,11 +595,10 @@ ** sqlite3_column_text16() failed. */ goto no_mem; } assert( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY ); assert( p->bIsReader || p->readOnly!=0 ); - p->rc = SQLITE_OK; p->iCurrentTime = 0; assert( p->explain==0 ); p->pResultSet = 0; db->busyHandler.nBusy = 0; if( db->u1.isInterrupted ) goto abort_due_to_interrupt; Index: src/vdbeblob.c ================================================================== --- src/vdbeblob.c +++ src/vdbeblob.c @@ -53,11 +53,10 @@ */ static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){ int rc; /* Error code */ char *zErr = 0; /* Error message */ Vdbe *v = (Vdbe *)p->pStmt; - sqlite3 *db = v->db; /* Set the value of register r[1] in the SQL statement to integer iRow. ** This is done directly as a performance optimization */ v->aMem[1].flags = MEM_Int; @@ -67,13 +66,11 @@ ** then back it up to the point where it does the OP_SeekRowid. This could ** have been down with an extra OP_Goto, but simply setting the program ** counter is faster. */ if( v->pc>3 ){ v->pc = 3; - db->nVdbeExec++; - rc = sqlite3VdbeExec((Vdbe*)p->pStmt); - db->nVdbeExec--; + rc = sqlite3VdbeExec(v); }else{ rc = sqlite3_step(p->pStmt); } if( rc==SQLITE_ROW ){ VdbeCursor *pC = v->apCsr[0]; Index: tool/kvtest-speed.sh ================================================================== --- tool/kvtest-speed.sh +++ tool/kvtest-speed.sh @@ -19,15 +19,14 @@ gcc -g -Os -I. $OPTS $* kvtest.c sqlite3.c -o kvtest # First run using SQL rm cachegrind.out.[1-9][0-9]* valgrind --tool=cachegrind ./kvtest run kvtest.db $KVARGS 2>&1 | tee summary-kvtest-$NAME.txt -mv cachegrind.out.[1-9][0-9]* cachegrind.out.$NAME -cg_anno.tcl cachegrind.out.$NAME >cout-kvtest-sql-$NAME.txt +mv cachegrind.out.[1-9][0-9]* cachegrind.out.sql-$NAME +cg_anno.tcl cachegrind.out.sql-$NAME >cout-kvtest-sql-$NAME.txt # Second run using the sqlite3_blob object -rm cachegrind.out.[1-9][0-9]* valgrind --tool=cachegrind ./kvtest run kvtest.db $KVARGS --blob-api 2>&1 | tee -a summary-kvtest-$NAME.txt mv cachegrind.out.[1-9][0-9]* cachegrind.out.$NAME cg_anno.tcl cachegrind.out.$NAME >cout-kvtest-$NAME.txt # Diff the sqlite3_blob API analysis for non-trunk runs.