/ Check-in [2f8bd5fa]
Login

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

Overview
Comment:Performance optimization in sqlite3WalkExpr().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2f8bd5fab8cc51d1f8932c3490fd24dbccf6ef31
User & Date: drh 2016-01-11 14:19:14
Context
2016-01-11
18:05
Performance optimization on the Column opcode. check-in: ecc98bef user: drh tags: trunk
14:19
Performance optimization in sqlite3WalkExpr(). check-in: 2f8bd5fa user: drh tags: trunk
12:52
Increase the version number to 3.11.0 due to the WAL overwrite enhancement. check-in: 8e807bfa user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/walker.c.

    32     32   **
    33     33   **    WRC_Abort         Do no more callbacks.  Unwind the stack and
    34     34   **                      return the top-level walk call.
    35     35   **
    36     36   ** The return value from this routine is WRC_Abort to abandon the tree walk
    37     37   ** and WRC_Continue to continue.
    38     38   */
    39         -int sqlite3WalkExpr(Walker *pWalker, Expr *pExpr){
           39  +static SQLITE_NOINLINE int walkExpr(Walker *pWalker, Expr *pExpr){
    40     40     int rc;
    41         -  if( pExpr==0 ) return WRC_Continue;
    42     41     testcase( ExprHasProperty(pExpr, EP_TokenOnly) );
    43     42     testcase( ExprHasProperty(pExpr, EP_Reduced) );
    44     43     rc = pWalker->xExprCallback(pWalker, pExpr);
    45     44     if( rc==WRC_Continue
    46     45                 && !ExprHasProperty(pExpr,EP_TokenOnly) ){
    47     46       if( sqlite3WalkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort;
    48     47       if( sqlite3WalkExpr(pWalker, pExpr->pRight) ) return WRC_Abort;
................................................................................
    50     49         if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
    51     50       }else{
    52     51         if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort;
    53     52       }
    54     53     }
    55     54     return rc & WRC_Abort;
    56     55   }
           56  +int sqlite3WalkExpr(Walker *pWalker, Expr *pExpr){
           57  +  return pExpr ? walkExpr(pWalker,pExpr) : WRC_Continue;
           58  +}
    57     59   
    58     60   /*
    59     61   ** Call sqlite3WalkExpr() for every expression in list p or until
    60     62   ** an abort request is seen.
    61     63   */
    62     64   int sqlite3WalkExprList(Walker *pWalker, ExprList *p){
    63     65     int i;