]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add a bypass path in sqlite3PagerWrite() for pages with the PGHDR_WRITEABLE
authordrh <drh@noemail.net>
Mon, 29 Jun 2015 20:53:18 +0000 (20:53 +0000)
committerdrh <drh@noemail.net>
Mon, 29 Jun 2015 20:53:18 +0000 (20:53 +0000)
bit set, for about a 1% performance increase.

FossilOrigin-Name: ba425a6abb9886e6af87b5f6205202db450beba8

manifest
manifest.uuid
src/pager.c

index 97944da70e7f0eaaa5331a2f1d53c0d3da089a5a..0e5abb1e89c27dbcfaea6873fa99991ebf6be2a4 100644 (file)
--- a/manifest
+++ b/manifest
@@ -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
index 76f6ffe525bb38241edbb375d7f541ab47a51168..ec2a9d057cc2ff992076ace156964a7dd7c47bb2 100644 (file)
@@ -1 +1 @@
-3b65eb56c422855ca47f709247205f0c77d98a5c
\ No newline at end of file
+ba425a6abb9886e6af87b5f6205202db450beba8
\ No newline at end of file
index bf6f8f4d6932ed3fb92d8f4d3097242fc59a0f79..6873a92044ee362260dc5d3961b0c8abfd8b17d9 100644 (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);
   }
 }