/ Check-in [e2c4995b]
Login

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

Overview
Comment:Performance optimization the Vdbe allocator.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e2c4995bf1099cc02bcb1dc4a4631f06a870d171
User & Date: drh 2016-04-12 00:26:59
Context
2016-04-12
11:58
Update the header comment on the memjournal.c file. No code changes. check-in: 07f10dea user: drh tags: trunk
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
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

  1785   1785     return pTab;
  1786   1786   }
  1787   1787   
  1788   1788   /*
  1789   1789   ** Get a VDBE for the given parser context.  Create a new one if necessary.
  1790   1790   ** If an error occurs, return NULL and leave a message in pParse.
  1791   1791   */
  1792         -Vdbe *sqlite3GetVdbe(Parse *pParse){
  1793         -  Vdbe *v = pParse->pVdbe;
  1794         -  if( v==0 ){
  1795         -    v = pParse->pVdbe = sqlite3VdbeCreate(pParse);
  1796         -    if( v ) sqlite3VdbeAddOp0(v, OP_Init);
  1797         -    if( pParse->pToplevel==0
  1798         -     && OptimizationEnabled(pParse->db,SQLITE_FactorOutConst)
  1799         -    ){
  1800         -      pParse->okConstFactor = 1;
  1801         -    }
  1802         -
         1792  +static SQLITE_NOINLINE Vdbe *allocVdbe(Parse *pParse){
         1793  +  Vdbe *v = pParse->pVdbe = sqlite3VdbeCreate(pParse);
         1794  +  if( v ) sqlite3VdbeAddOp0(v, OP_Init);
         1795  +  if( pParse->pToplevel==0
         1796  +   && OptimizationEnabled(pParse->db,SQLITE_FactorOutConst)
         1797  +  ){
         1798  +    pParse->okConstFactor = 1;
  1803   1799     }
  1804   1800     return v;
         1801  +}
         1802  +Vdbe *sqlite3GetVdbe(Parse *pParse){
         1803  +  Vdbe *v = pParse->pVdbe;
         1804  +  return v ? v : allocVdbe(pParse);
  1805   1805   }
  1806   1806   
  1807   1807   
  1808   1808   /*
  1809   1809   ** Compute the iLimit and iOffset fields of the SELECT based on the
  1810   1810   ** pLimit and pOffset expressions.  pLimit and pOffset hold the expressions
  1811   1811   ** that appear in the original SQL statement after the LIMIT and OFFSET