From: drh Date: Fri, 12 Sep 2014 20:30:59 +0000 (+0000) Subject: Small performance improvement to the dirty list handling in the pager. X-Git-Tag: version-3.8.7~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36ce91913c7923e06f1b6cdb8385812fd0fe9998;p=thirdparty%2Fsqlite.git Small performance improvement to the dirty list handling in the pager. FossilOrigin-Name: b332a84d5154f70f3197537df4af243eaebbb011 --- diff --git a/manifest b/manifest index 8501d7bcd0..81daedebde 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Simplify\sthe\sway\sthe\scolumn\scache\sis\smanaged\saround\sOP_Move\sinstructions. -D 2014-09-12T17:41:30.440 +C Small\sperformance\simprovement\sto\sthe\sdirty\slist\shandling\sin\sthe\spager. +D 2014-09-12T20:30:59.762 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -217,7 +217,7 @@ F src/os_win.h 09e751b20bbc107ffbd46e13555dc73576d88e21 F src/pager.c c6c809987f0c6a4e27634099d062d425527de173 F src/pager.h ffd5607f7b3e4590b415b007a4382f693334d428 F src/parse.y 22d6a074e5f5a7258947a1dc55a9bf946b765dd0 -F src/pcache.c 2048affdb09a04478b5fc6e64cb1083078d369be +F src/pcache.c b42c513da255c33e99dc0e23d16c3caf30dc9175 F src/pcache.h 9b559127b83f84ff76d735c8262f04853be0c59a F src/pcache1.c dab8ab930d4a73b99768d881185994f34b80ecaa F src/pragma.c 3f3e959390a10c0131676f0e307acce372777e0f @@ -1197,7 +1197,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2f69a1fa6adc9377149ae7faa586a5d30b6a631b -R 2196198b201612a018f7c15a4c2f1424 +P 320556233e19cdd9d590a09655c3465754700d39 +R 576d19acba6677524711080ef6f39102 U drh -Z a609740927532bd8f27cb3bc904eb4ff +Z 60cbf2357ae42b4a38f44133d16be246 diff --git a/manifest.uuid b/manifest.uuid index 2b28a6b8f4..7821ed52ba 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -320556233e19cdd9d590a09655c3465754700d39 \ No newline at end of file +b332a84d5154f70f3197537df4af243eaebbb011 \ No newline at end of file diff --git a/src/pcache.c b/src/pcache.c index 801df2b02a..e975e43889 100644 --- a/src/pcache.c +++ b/src/pcache.c @@ -116,14 +116,14 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ if( pPage->pDirtyNext ){ assert( pPage->pDirtyNext->pDirtyPrev==0 ); pPage->pDirtyNext->pDirtyPrev = pPage; - }else if( p->bPurgeable ){ - assert( p->eCreate==2 ); - p->eCreate = 1; - } - p->pDirty = pPage; - if( !p->pDirtyTail ){ + }else{ p->pDirtyTail = pPage; + if( p->bPurgeable ){ + assert( p->eCreate==2 ); + p->eCreate = 1; + } } + p->pDirty = pPage; if( !p->pSynced && 0==(pPage->flags&PGHDR_NEED_SYNC) ){ p->pSynced = pPage; } @@ -399,7 +399,7 @@ void SQLITE_NOINLINE sqlite3PcacheRelease(PgHdr *p){ p->pCache->nRef--; if( (p->flags&PGHDR_DIRTY)==0 ){ pcacheUnpin(p); - }else{ + }else if( p->pDirtyPrev!=0 ){ /* Move the page to the head of the dirty list. */ pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT); }