mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Add a bypass path in sqlite3PagerWrite() for pages with the PGHDR_WRITEABLE
bit set, for about a 1% performance increase. FossilOrigin-Name: ba425a6abb9886e6af87b5f6205202db450beba8
This commit is contained in:
@@ -2218,7 +2218,7 @@ static int pager_playback_one_page(
|
||||
}
|
||||
}
|
||||
|
||||
/* If this page has already been played by before during the current
|
||||
/* If this page has already been played back before during the current
|
||||
** rollback, then don't bother to play it back again.
|
||||
*/
|
||||
if( pDone && (rc = sqlite3BitvecSet(pDone, pgno))!=SQLITE_OK ){
|
||||
@@ -5872,7 +5872,11 @@ int sqlite3PagerWrite(PgHdr *pPg){
|
||||
assert( pPg->pPager->eState>=PAGER_WRITER_LOCKED );
|
||||
assert( pPg->pPager->eState!=PAGER_ERROR );
|
||||
assert( assert_pager_state(pPg->pPager) );
|
||||
if( pPg->pPager->sectorSize > (u32)pPg->pPager->pageSize ){
|
||||
Pager *pPager = pPg->pPager;
|
||||
if( (pPg->flags & PGHDR_WRITEABLE)!=0 && pPager->dbSize>=pPg->pgno ){
|
||||
if( pPager->nSavepoint ) return subjournalPageIfRequired(pPg);
|
||||
return SQLITE_OK;
|
||||
}else if( pPager->sectorSize > (u32)pPager->pageSize ){
|
||||
return pagerWriteLargeSector(pPg);
|
||||
}else{
|
||||
return pager_write(pPg);
|
||||
@@ -5910,6 +5914,7 @@ void sqlite3PagerDontWrite(PgHdr *pPg){
|
||||
PAGERTRACE(("DONT_WRITE page %d of %d\n", pPg->pgno, PAGERID(pPager)));
|
||||
IOTRACE(("CLEAN %p %d\n", pPager, pPg->pgno))
|
||||
pPg->flags |= PGHDR_DONT_WRITE;
|
||||
pPg->flags &= ~PGHDR_WRITEABLE;
|
||||
pager_set_pagehash(pPg);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user