/ Check-in [03f2e788]
Login

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 Unified Diffs Show Whitespace Changes Patch

Changes to src/wal.c.

2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920

    rc = walHashGet(pWal, iHash, &sLoc);
    if( rc!=SQLITE_OK ){
      return rc;
    }
    nCollide = HASHTABLE_NSLOT;
    for(iKey=walHash(pgno); sLoc.aHash[iKey]; iKey=walNextHash(iKey)){
      u32 iFrame = sLoc.aHash[iKey] + sLoc.iZero;
      if( iFrame<=iLast && iFrame>=pWal->minFrame
       && sLoc.aPgno[sLoc.aHash[iKey]]==pgno ){
        assert( iFrame>iRead || CORRUPT_DB );
        iRead = iFrame;
      }
      if( (nCollide--)==0 ){
        return SQLITE_CORRUPT_BKPT;
      }
    }







|
|
|







2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920

    rc = walHashGet(pWal, iHash, &sLoc);
    if( rc!=SQLITE_OK ){
      return rc;
    }
    nCollide = HASHTABLE_NSLOT;
    for(iKey=walHash(pgno); sLoc.aHash[iKey]; iKey=walNextHash(iKey)){
      u32 iH = sLoc.aHash[iKey];
      u32 iFrame = iH + sLoc.iZero;
      if( iFrame<=iLast && iFrame>=pWal->minFrame && sLoc.aPgno[iH]==pgno ){
        assert( iFrame>iRead || CORRUPT_DB );
        iRead = iFrame;
      }
      if( (nCollide--)==0 ){
        return SQLITE_CORRUPT_BKPT;
      }
    }