]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Performance improvement: reduce the number of calls to ptrmapPageno() made by ptrmapP...
authordanielk1977 <danielk1977@noemail.net>
Fri, 18 Jul 2008 09:34:57 +0000 (09:34 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Fri, 18 Jul 2008 09:34:57 +0000 (09:34 +0000)
FossilOrigin-Name: d807fb271340901bbf3e06de23d91132422d1408

manifest
manifest.uuid
src/btree.c
src/btreeInt.h

index 79e45f022f35e6ef860fc801916405fdbbe5d5bb..f2aaa5394ecfe43252428e1d0bc58a9866f5b5fc 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Speed\sup\ssqlite3_finalize()\sby\sremoving\sredundant\scode.\s(CVS\s5436)
-D 2008-07-18T08:10:47
+C Performance\simprovement:\sreduce\sthe\snumber\sof\scalls\sto\sptrmapPageno()\smade\sby\sptrmapPut()\sand\sptrmapGet().\s(CVS\s5437)
+D 2008-07-18T09:34:57
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in a03f7cb4f7ad50bc53a788c6c544430e81f95de4
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -96,9 +96,9 @@ F src/attach.c b18ba42c77f7d3941f5d23d2ca20fa1d841a4e91
 F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
 F src/bitvec.c 95c86bd18d8fedf0533f5af196192546e10a7e7d
 F src/btmutex.c 709cad2cdca0afd013f0f612363810e53f59ec53
-F src/btree.c af2bc332a50f5f364ba2cb00c728203f9a1d004b
+F src/btree.c 95640f016d8f5e086a06d37d5d24d45f54582aff
 F src/btree.h 03256ed7ee42b5ecacbe887070b0f8249e7d069d
-F src/btreeInt.h e5b952467935fc29033da138c3d74673329d9770
+F src/btreeInt.h 6e4cb69a9192a8d609c27034ae5f921cf0ecdde1
 F src/build.c bac7233d984be3805aaa41cf500f7ee12dc97249
 F src/callback.c aa492a0ad8c2d454edff9fb8a57fae13743cf71d
 F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
@@ -608,7 +608,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 70685b2ae8bbb8ab4316a762e1c1cc59b8032e0b
-R 0fac37338ff457c8a8ccb096c255b171
+P c94318b982e9bb5b4c743cf8d5659f9eec697366
+R 1c9e4fce9b074d6791cf7915301ae383
 U danielk1977
-Z 5ba21847fa73d9eab64482a9b27dcd85
+Z a5d1990c3bbe25fa6befea839cd03776
index 4bb8b726a4d4e1bb60000279e7d9a952f731b3f7..7e78ab34ca44355105f466ae2ca94eaebbf03d08 100644 (file)
@@ -1 +1 @@
-c94318b982e9bb5b4c743cf8d5659f9eec697366
\ No newline at end of file
+d807fb271340901bbf3e06de23d91132422d1408
\ No newline at end of file
index a0ba6874e0adee1b41674733036a2d7412b7d036..a808696847adec369351350edcfa5859e2119c66 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.487 2008/07/18 03:32:51 drh Exp $
+** $Id: btree.c,v 1.488 2008/07/18 09:34:57 danielk1977 Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -458,7 +458,7 @@ static int ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent){
   if( rc!=SQLITE_OK ){
     return rc;
   }
-  offset = PTRMAP_PTROFFSET(pBt, key);
+  offset = PTRMAP_PTROFFSET(iPtrmap, key);
   pPtrmap = (u8 *)sqlite3PagerGetData(pDbPage);
 
   if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){
@@ -497,7 +497,7 @@ static int ptrmapGet(BtShared *pBt, Pgno key, u8 *pEType, Pgno *pPgno){
   }
   pPtrmap = (u8 *)sqlite3PagerGetData(pDbPage);
 
-  offset = PTRMAP_PTROFFSET(pBt, key);
+  offset = PTRMAP_PTROFFSET(iPtrmap, key);
   assert( pEType!=0 );
   *pEType = pPtrmap[offset];
   if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]);
index 1601ce11b53601fe007d9b5981e711561682a565..8ff963659ccaf4bc3dd22f02e68c65aac2c49ea4 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btreeInt.h,v 1.28 2008/07/18 02:44:18 drh Exp $
+** $Id: btreeInt.h,v 1.29 2008/07/18 09:34:57 danielk1977 Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** For a detailed discussion of BTrees, refer to
@@ -527,7 +527,7 @@ struct BtLock {
 ** this test.
 */
 #define PTRMAP_PAGENO(pBt, pgno) ptrmapPageno(pBt, pgno)
-#define PTRMAP_PTROFFSET(pBt, pgno) (5*(pgno-ptrmapPageno(pBt, pgno)-1))
+#define PTRMAP_PTROFFSET(pgptrmap, pgno) (5*(pgno-pgptrmap-1))
 #define PTRMAP_ISPAGE(pBt, pgno) (PTRMAP_PAGENO((pBt),(pgno))==(pgno))
 
 /*