/ Check-in [aec94b6e]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Avoid unnecessary calls to object destructors for a small performance gain.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: aec94b6ee68fe50e2cc14388281e2ef531e21d68
User & Date: drh 2016-04-12 00:16:54
Context
2016-04-12
00:26
Performance optimization the Vdbe allocator. check-in: e2c4995b user: drh tags: trunk
00:16
Avoid unnecessary calls to object destructors for a small performance gain. check-in: aec94b6e user: drh tags: trunk
00:00
Performance improvements in sqlite3WhereExprUsage(). check-in: fdf75239 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/select.c.

    70     70       sqlite3SrcListDelete(db, p->pSrc);
    71     71       sqlite3ExprDelete(db, p->pWhere);
    72     72       sqlite3ExprListDelete(db, p->pGroupBy);
    73     73       sqlite3ExprDelete(db, p->pHaving);
    74     74       sqlite3ExprListDelete(db, p->pOrderBy);
    75     75       sqlite3ExprDelete(db, p->pLimit);
    76     76       sqlite3ExprDelete(db, p->pOffset);
    77         -    sqlite3WithDelete(db, p->pWith);
           77  +    if( p->pWith ) sqlite3WithDelete(db, p->pWith);
    78     78       if( bFree ) sqlite3DbFree(db, p);
    79     79       p = pPrior;
    80     80       bFree = 1;
    81     81     }
    82     82   }
    83     83   
    84     84   /*
................................................................................
   165    165   #endif
   166    166   
   167    167   
   168    168   /*
   169    169   ** Delete the given Select structure and all of its substructures.
   170    170   */
   171    171   void sqlite3SelectDelete(sqlite3 *db, Select *p){
   172         -  clearSelect(db, p, 1);
          172  +  if( p ) clearSelect(db, p, 1);
   173    173   }
   174    174   
   175    175   /*
   176    176   ** Return a pointer to the right-most SELECT statement in a compound.
   177    177   */
   178    178   static Select *findRightmost(Select *p){
   179    179     while( p->pNext ) p = p->pNext;

Changes to src/tokenize.c.

   579    579       /* If the pParse->declareVtab flag is set, do not delete any table 
   580    580       ** structure built up in pParse->pNewTable. The calling code (see vtab.c)
   581    581       ** will take responsibility for freeing the Table structure.
   582    582       */
   583    583       sqlite3DeleteTable(db, pParse->pNewTable);
   584    584     }
   585    585   
   586         -  sqlite3WithDelete(db, pParse->pWithToFree);
          586  +  if( pParse->pWithToFree ) sqlite3WithDelete(db, pParse->pWithToFree);
   587    587     sqlite3DeleteTrigger(db, pParse->pNewTrigger);
   588    588     for(i=pParse->nzVar-1; i>=0; i--) sqlite3DbFree(db, pParse->azVar[i]);
   589    589     sqlite3DbFree(db, pParse->azVar);
   590    590     while( pParse->pAinc ){
   591    591       AutoincInfo *p = pParse->pAinc;
   592    592       pParse->pAinc = p->pNext;
   593    593       sqlite3DbFree(db, p);