-C Optimization\sto\ssqltie3BtreeParseCellPtr.\s\s0.3%\sperformance\sincrease.\s(CVS\s5432)
-D 2008-07-18T00:57:33
+C Omit\sthe\scheck\sfor\scell-pointer\sconsistency\sin\ssqlite3BtreeInitPage()\nfor\sa\s2.5%\sperformance\sgain.\s(CVS\s5433)
+D 2008-07-18T02:44:18
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in a03f7cb4f7ad50bc53a788c6c544430e81f95de4
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
F src/bitvec.c 95c86bd18d8fedf0533f5af196192546e10a7e7d
F src/btmutex.c 709cad2cdca0afd013f0f612363810e53f59ec53
-F src/btree.c 5299a702966d3c32618340cae49cebafc5e93870
+F src/btree.c 134d2f76fb9144e81b6ca9e426922ac3626d1d77
F src/btree.h 03256ed7ee42b5ecacbe887070b0f8249e7d069d
-F src/btreeInt.h 2aa6dc53b1801bb22815a5be22e03be121f3bd8f
+F src/btreeInt.h e5b952467935fc29033da138c3d74673329d9770
F src/build.c bac7233d984be3805aaa41cf500f7ee12dc97249
F src/callback.c aa492a0ad8c2d454edff9fb8a57fae13743cf71d
F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 29d3bfd7c9a68078385354394052612bf812859b
-R 52c1e00d28149edaa06e0b96ba148399
+P 77e099ad7de84fe07dfeb4c045c769653dd13b93
+R c5135664a56b05b1461fc48c1c5e4a98
U drh
-Z ba442f29937e797f8880a62ff02e96e8
+Z 1e2af38c22a126d0243f54deb66a7f3a
-77e099ad7de84fe07dfeb4c045c769653dd13b93
\ No newline at end of file
+b88087e69dffb743c5b552703e14a030349cf65b
\ No newline at end of file
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.485 2008/07/18 00:57:33 drh Exp $
+** $Id: btree.c,v 1.486 2008/07/18 02:44:18 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
**
** This routine works only for pages that do not contain overflow cells.
*/
-#define findCell(pPage, iCell) \
- ((pPage)->aData + get2byte(&(pPage)->aData[(pPage)->cellOffset+2*(iCell)]))
+#define findCell(P,I) \
+ ((P)->aData + ((P)->maskPage & get2byte(&(P)->aData[(P)->cellOffset+2*(I)])))
/*
** This a more complex version of findCell() that works for
int cellOffset; /* Offset from start of page to first cell pointer */
int nFree; /* Number of unused bytes on the page */
int top; /* First byte of the cell content area */
- u8 *pOff; /* Iterator used to check all cell offsets are in range */
- u8 *pEnd; /* Pointer to end of cell offset array */
- u8 mask; /* Mask of bits that must be zero in MSB of cell offsets */
pBt = pPage->pBt;
assert( pBt!=0 );
hdr = pPage->hdrOffset;
data = pPage->aData;
if( decodeFlags(pPage, data[hdr]) ) return SQLITE_CORRUPT_BKPT;
+ assert( pBt->pageSize>=512 && pBt->pageSize<=32768 );
+ pPage->maskPage = pBt->pageSize - 1;
pPage->nOverflow = 0;
pPage->idxShift = 0;
usableSize = pBt->usableSize;
return SQLITE_CORRUPT_BKPT;
}
- /* Check that all the offsets in the cell offset array are within range. */
- mask = ~(((u8)(pBt->pageSize>>8))-1);
- pEnd = &data[cellOffset + pPage->nCell*2];
- for(pOff=&data[cellOffset]; pOff!=pEnd && !((*pOff)&mask); pOff+=2);
- if( pOff!=pEnd ){
- return SQLITE_CORRUPT_BKPT;
+#if 0
+ /* Check that all the offsets in the cell offset array are within range.
+ **
+ ** Omitting this consistency check and using the pPage->maskPage mask
+ ** to prevent overrunning the page buffer in findCell() results in a
+ ** 2.5% performance gain.
+ */
+ {
+ u8 *pOff; /* Iterator used to check all cell offsets are in range */
+ u8 *pEnd; /* Pointer to end of cell offset array */
+ u8 mask; /* Mask of bits that must be zero in MSB of cell offsets */
+ mask = ~(((u8)(pBt->pageSize>>8))-1);
+ pEnd = &data[cellOffset + pPage->nCell*2];
+ for(pOff=&data[cellOffset]; pOff!=pEnd && !((*pOff)&mask); pOff+=2);
+ if( pOff!=pEnd ){
+ return SQLITE_CORRUPT_BKPT;
+ }
}
+#endif
pPage->isInit = 1;
return SQLITE_OK;
pPage->hdrOffset = hdr;
pPage->cellOffset = first;
pPage->nOverflow = 0;
+ assert( pBt->pageSize>=512 && pBt->pageSize<=32768 );
+ pPage->maskPage = pBt->pageSize - 1;
pPage->idxShift = 0;
pPage->nCell = 0;
pPage->isInit = 1;
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btreeInt.h,v 1.27 2008/07/17 18:39:58 drh Exp $
+** $Id: btreeInt.h,v 1.28 2008/07/18 02:44:18 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
u16 idxParent; /* Index in parent of this node */
u16 nFree; /* Number of free bytes on the page */
u16 nCell; /* Number of cells on this page, local and ovfl */
+ u16 maskPage; /* Mask for page offset */
struct _OvflCell { /* Cells that will not fit on aData[] */
u8 *pCell; /* Pointers to the body of the overflow cell */
u16 idx; /* Insert this cell before idx-th non-overflow cell */