/ Check-in [03f2e788]
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:Small performance and size optimization in sqlite3WalFindFrame().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 03f2e78899fad99b0a0951b3a408268276954d4cd785389ed9a0192c9217f6fe
User & Date: drh 2019-04-17 21:12:05
Context
2019-04-19
13:38
Streamline the processing of the AND operator. Slightly smaller and faster. check-in: 7713996a user: drh tags: trunk
2019-04-18
19:21
Minor simplification of NULL value handling for STAT4. Closed-Leaf check-in: 5718a9d5 user: mistachkin tags: nullStat4
2019-04-17
23:32
Work around lack of a C99 feature in MSVC. check-in: f6ebe1c2 user: mistachkin tags: msvc
21:12
Small performance and size optimization in sqlite3WalFindFrame(). check-in: 03f2e788 user: drh tags: trunk
13:58
Fix a typo in the CLI help output for the ".dump" command. check-in: 57638248 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/wal.c.

  2904   2904   
  2905   2905       rc = walHashGet(pWal, iHash, &sLoc);
  2906   2906       if( rc!=SQLITE_OK ){
  2907   2907         return rc;
  2908   2908       }
  2909   2909       nCollide = HASHTABLE_NSLOT;
  2910   2910       for(iKey=walHash(pgno); sLoc.aHash[iKey]; iKey=walNextHash(iKey)){
  2911         -      u32 iFrame = sLoc.aHash[iKey] + sLoc.iZero;
  2912         -      if( iFrame<=iLast && iFrame>=pWal->minFrame
  2913         -       && sLoc.aPgno[sLoc.aHash[iKey]]==pgno ){
         2911  +      u32 iH = sLoc.aHash[iKey];
         2912  +      u32 iFrame = iH + sLoc.iZero;
         2913  +      if( iFrame<=iLast && iFrame>=pWal->minFrame && sLoc.aPgno[iH]==pgno ){
  2914   2914           assert( iFrame>iRead || CORRUPT_DB );
  2915   2915           iRead = iFrame;
  2916   2916         }
  2917   2917         if( (nCollide--)==0 ){
  2918   2918           return SQLITE_CORRUPT_BKPT;
  2919   2919         }
  2920   2920       }