/ Check-in [c4e7e175]
Login

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

Overview
Comment:Remove an obsolete optimization in pcache that due to more recent changes was recently making the code a little slower.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:c4e7e175eecfd79015f4fae99618dfce6baf97c21bf3c909ea535d4e12dcaaad
User & Date: drh 2017-09-01 12:57:33
Context
2017-09-01
14:50
Add the new sqlite3PagerUnrefPageOne() pager method to deal with the special case of unreferencing page1. check-in: b2e2100c user: drh tags: trunk
12:57
Remove an obsolete optimization in pcache that due to more recent changes was recently making the code a little slower. check-in: c4e7e175 user: drh tags: trunk
12:18
Small size and performance improvement in pcacheManageDirtyList() by not zeroing the PgHdr.pDirtyNext and PgHdr.pDirtyPrev pointers for PgHdr objects that are not on the dirty list. check-in: 919863b1 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pcache.c.

506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
*/
void SQLITE_NOINLINE sqlite3PcacheRelease(PgHdr *p){
  assert( p->nRef>0 );
  p->pCache->nRefSum--;
  if( (--p->nRef)==0 ){
    if( p->flags&PGHDR_CLEAN ){
      pcacheUnpin(p);
    }else if( p->pDirtyPrev!=0 ){ /*OPTIMIZATION-IF-FALSE*/
      /* Move the page to the head of the dirty list. If p->pDirtyPrev==0,
      ** then page p is already at the head of the dirty list and the
      ** following call would be a no-op. Hence the OPTIMIZATION-IF-FALSE
      ** tag above.  */
      pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT);
    }
  }
}

/*
** Increase the reference count of a supplied page by 1.







|
<
<
<
<







506
507
508
509
510
511
512
513




514
515
516
517
518
519
520
*/
void SQLITE_NOINLINE sqlite3PcacheRelease(PgHdr *p){
  assert( p->nRef>0 );
  p->pCache->nRefSum--;
  if( (--p->nRef)==0 ){
    if( p->flags&PGHDR_CLEAN ){
      pcacheUnpin(p);
    }else{




      pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT);
    }
  }
}

/*
** Increase the reference count of a supplied page by 1.