1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +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:
drh
2015-06-29 20:53:18 +00:00
parent 60e32edba5
commit b34755308c
3 changed files with 14 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
C Combine\ssubjRequiresPage()\sand\ssubjournalPage()\sinto\sa\ssingle\nsubjournalPageIfRequired()\sroutine.
D 2015-06-29T19:08:18.213
C Add\sa\sbypass\spath\sin\ssqlite3PagerWrite()\sfor\spages\swith\sthe\sPGHDR_WRITEABLE\nbit\sset,\sfor\sabout\sa\s1%\sperformance\sincrease.
D 2015-06-29T20:53:18.096
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 285a0a234ed7610d431d91671c136098c2bd86a9
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -314,7 +314,7 @@ F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
F src/os_unix.c 23eb5f56fac54d8fe0cb204291f3b3b2d94f23fc
F src/os_win.c 27cc135e2d0b8b1e2e4944db1e2669a6a18fa0f8
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
F src/pager.c 4cf1b151727f5f12898927c6688b167fd4999d14
F src/pager.c 6ae566c373f74be311b5975eef8f6dd130551bd5
F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77
F src/parse.y 6d60dda8f8d418b6dc034f1fbccd816c459983a8
F src/pcache.c 379fd77feb732b39750eb733260d9c227d8a4314
@@ -1364,7 +1364,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 7c4ef7b7c8744af19075bb96d1e0b63e35978ed1
R f62d201ad6eea9a89949366a04424df3
P 3b65eb56c422855ca47f709247205f0c77d98a5c
R 7a2e6c81396cabeccb9e57205ef7b5ff
U drh
Z d7a21ab6fd66c107b4716f65f30e363a
Z 8e32abe3d4ffc02aca1a13a0a405eb07

View File

@@ -1 +1 @@
3b65eb56c422855ca47f709247205f0c77d98a5c
ba425a6abb9886e6af87b5f6205202db450beba8

View File

@@ -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);
}
}