/ Check-in [326e63d7]
Login

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

Overview
Comment:Reorder fields in the PgHdr object for a performance increase.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 326e63d71e0e164c5bcd1f74772cb4071b82daf6f04a5d440b985bace5a4c941
User & Date: drh 2017-05-31 03:20:39
Context
2017-05-31
11:24
Very small performance increase in sqlite3VdbeSetNumCols(). check-in: 8885b446 user: drh tags: trunk
03:20
Reorder fields in the PgHdr object for a performance increase. check-in: 326e63d7 user: drh tags: trunk
02:58
Avoid unnecessary memory zeroing during expression list allocation. check-in: de28e651 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pcache.h.

    22     22   ** Every page in the cache is controlled by an instance of the following
    23     23   ** structure.
    24     24   */
    25     25   struct PgHdr {
    26     26     sqlite3_pcache_page *pPage;    /* Pcache object page handle */
    27     27     void *pData;                   /* Page data */
    28     28     void *pExtra;                  /* Extra content */
           29  +  PCache *pCache;                /* PRIVATE: Cache that owns this page */
    29     30     PgHdr *pDirty;                 /* Transient list of dirty sorted by pgno */
    30     31     Pager *pPager;                 /* The pager this page is part of */
    31     32     Pgno pgno;                     /* Page number for this page */
    32     33   #ifdef SQLITE_CHECK_PAGES
    33     34     u32 pageHash;                  /* Hash of page content */
    34     35   #endif
    35     36     u16 flags;                     /* PGHDR flags defined below */
    36     37   
    37     38     /**********************************************************************
    38         -  ** Elements above are public.  All that follows is private to pcache.c
    39         -  ** and should not be accessed by other modules.
           39  +  ** Elements above, except pCache, are public.  All that follow are 
           40  +  ** private to pcache.c and should not be accessed by other modules.
           41  +  ** pCache is grouped with the public elements for efficiency.
    40     42     */
    41     43     i16 nRef;                      /* Number of users of this page */
    42         -  PCache *pCache;                /* Cache that owns this page */
    43         -
    44     44     PgHdr *pDirtyNext;             /* Next element in list of dirty pages */
    45     45     PgHdr *pDirtyPrev;             /* Previous element in list of dirty pages */
    46     46   };
    47     47   
    48     48   /* Bit values for PgHdr.flags */
    49     49   #define PGHDR_CLEAN           0x001  /* Page not on the PCache.pDirty list */
    50     50   #define PGHDR_DIRTY           0x002  /* Page is on the PCache.pDirty list */