/ Check-in [0ea2762f]
Login

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

Overview
Comment:Three times faster sqlite3SrcListAppend() in the common case by avoiding the call to sqlite3SrcListEnlarge() for the first allocation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0ea2762f1d8f6a93ae2ee3b7b835927a474c6f66
User & Date: drh 2016-12-14 11:14:13
Context
2016-12-14
11:23
Adjust the unix makefiles so that "make test" runs fuzzcheck prior to even attempting to build the other test programs. check-in: bb48f7a5 user: drh tags: trunk
11:14
Three times faster sqlite3SrcListAppend() in the common case by avoiding the call to sqlite3SrcListEnlarge() for the first allocation. check-in: 0ea2762f user: drh tags: trunk
10:30
Fix the optimization that prevents writing freelist pages to the journal. check-in: 6aa9b265 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

  3732   3732     struct SrcList_item *pItem;
  3733   3733     assert( pDatabase==0 || pTable!=0 );  /* Cannot have C without B */
  3734   3734     assert( db!=0 );
  3735   3735     if( pList==0 ){
  3736   3736       pList = sqlite3DbMallocRawNN(db, sizeof(SrcList) );
  3737   3737       if( pList==0 ) return 0;
  3738   3738       pList->nAlloc = 1;
  3739         -    pList->nSrc = 0;
         3739  +    pList->nSrc = 1;
         3740  +    memset(&pList->a[0], 0, sizeof(pList->a[0]));
         3741  +    pList->a[0].iCursor = -1;
         3742  +  }else{
         3743  +    pList = sqlite3SrcListEnlarge(db, pList, 1, pList->nSrc);
  3740   3744     }
  3741         -  pList = sqlite3SrcListEnlarge(db, pList, 1, pList->nSrc);
  3742   3745     if( db->mallocFailed ){
  3743   3746       sqlite3SrcListDelete(db, pList);
  3744   3747       return 0;
  3745   3748     }
  3746   3749     pItem = &pList->a[pList->nSrc-1];
  3747   3750     if( pDatabase && pDatabase->z==0 ){
  3748   3751       pDatabase = 0;