/ Check-in [60ad80e3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Performance improvement in sqlite3ExprDelete().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:60ad80e3af4bae9f5c74fedf09eec9689e2e3dbf
User & Date: drh 2016-04-11 14:49:39
Context
2016-04-11
16:35
Rename the OP_MX_JUMP macro to SQLITE_MX_JUMP_OPCODE to avoid confusing the opcode name generator. check-in: e554a4c3 user: drh tags: trunk
14:49
Performance improvement in sqlite3ExprDelete(). check-in: 60ad80e3 user: drh tags: trunk
13:36
Remove the VdbeOp.opflags field and its associated initialization overhead. Update mkopcodeh.tcl to reorder opcode numbers to help the resolveP2Values() routine run faster. check-in: 099478fa user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

   734    734       sqlite3ErrorMsg(pParse, "too many SQL variables");
   735    735     }
   736    736   }
   737    737   
   738    738   /*
   739    739   ** Recursively delete an expression tree.
   740    740   */
   741         -void sqlite3ExprDelete(sqlite3 *db, Expr *p){
   742         -  if( p==0 ) return;
          741  +static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
          742  +  assert( p!=0 );
   743    743     /* Sanity check: Assert that the IntValue is non-negative if it exists */
   744    744     assert( !ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0 );
   745    745     if( !ExprHasProperty(p, EP_TokenOnly) ){
   746    746       /* The Expr.x union is never used at the same time as Expr.pRight */
   747    747       assert( p->x.pList==0 || p->pRight==0 );
   748    748       sqlite3ExprDelete(db, p->pLeft);
   749    749       sqlite3ExprDelete(db, p->pRight);
................................................................................
   753    753       }else{
   754    754         sqlite3ExprListDelete(db, p->x.pList);
   755    755       }
   756    756     }
   757    757     if( !ExprHasProperty(p, EP_Static) ){
   758    758       sqlite3DbFree(db, p);
   759    759     }
          760  +}
          761  +void sqlite3ExprDelete(sqlite3 *db, Expr *p){
          762  +  if( p ) sqlite3ExprDeleteNN(db, p);
   760    763   }
   761    764   
   762    765   /*
   763    766   ** Return the number of bytes allocated for the expression structure 
   764    767   ** passed as the first argument. This is always one of EXPR_FULLSIZE,
   765    768   ** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE.
   766    769   */