From: drh Date: Wed, 17 Jun 2015 02:11:46 +0000 (+0000) Subject: Make getCellInfo() a real function instead of a macro, for a size reduction X-Git-Tag: version-3.8.11~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5b41ac8ee9f322e19d6a781763da19530fbbe63;p=thirdparty%2Fsqlite.git Make getCellInfo() a real function instead of a macro, for a size reduction and a 0.2% performance gain. FossilOrigin-Name: 55c393ea14197ae5fa56ebca7a47e7d980511fa7 --- diff --git a/manifest b/manifest index 573ebff619..fc919c6ac0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Optimizations\sto\stwo\sVDBE\saccessory\sroutines\sfor\sa\s0.2%\sperformance\sincrease. -D 2015-06-17T01:31:28.018 +C Make\sgetCellInfo()\sa\sreal\sfunction\sinstead\sof\sa\smacro,\sfor\sa\ssize\sreduction\nand\sa\s0.2%\sperformance\sgain. +D 2015-06-17T02:11:46.631 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 1063c58075b7400d93326b0eb332b48a54f53025 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -192,7 +192,7 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c ff743689c4d6c5cb55ad42ed9d174b2b3e71f1e3 F src/bitvec.c 5eb7958c3bf65210211cbcfc44eff86d0ded7c9d F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79 -F src/btree.c e557af3120ac3e5cea9680ca12688cf26b0222bc +F src/btree.c 02caf39192ed1f5c7157a1aac0b2ff23389233de F src/btree.h 969adc948e89e449220ff0ff724c94bb2a52e9f1 F src/btreeInt.h 973a22a6fd61350b454ad614832b1f0a5e25a1e4 F src/build.c b3f15255d5b16e42dafeaa638fd4f8a47c94ed70 @@ -1286,7 +1286,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 400e025e7c61efab71b891743c07a0862e5bb934 -R d6ec7bd1e825895971b1bb96fc6c1218 +P 66d033b9c9a8c16b9a342be0b325bd85b8487c03 +R b009f7bdded8eda946c7f086260f521c U drh -Z dd5ab0f28ac99d3509e4690cbccf7594 +Z e2dd593dbc0c1057f97a55b340af2663 diff --git a/manifest.uuid b/manifest.uuid index 8870f66ad6..ea7a1a60de 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -66d033b9c9a8c16b9a342be0b325bd85b8487c03 \ No newline at end of file +55c393ea14197ae5fa56ebca7a47e7d980511fa7 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index edd0f611d2..eab5b98426 100644 --- a/src/btree.c +++ b/src/btree.c @@ -3985,13 +3985,6 @@ int sqlite3BtreeCloseCursor(BtCursor *pCur){ ** ** BtCursor.info is a cache of the information in the current cell. ** Using this cache reduces the number of calls to btreeParseCell(). -** -** 2007-06-25: There is a bug in some versions of MSVC that cause the -** compiler to crash when getCellInfo() is implemented as a macro. -** But there is a measureable speed advantage to using the macro on gcc -** (when less compiler optimizations like -Os or -O0 are used and the -** compiler is not doing aggressive inlining.) So we use a real function -** for MSVC and a macro for everything else. Ticket #2457. */ #ifndef NDEBUG static void assertCellInfo(BtCursor *pCur){ @@ -4004,28 +3997,15 @@ int sqlite3BtreeCloseCursor(BtCursor *pCur){ #else #define assertCellInfo(x) #endif -#ifdef _MSC_VER - /* Use a real function in MSVC to work around bugs in that compiler. */ - static void getCellInfo(BtCursor *pCur){ - if( pCur->info.nSize==0 ){ - int iPage = pCur->iPage; - btreeParseCell(pCur->apPage[iPage],pCur->aiIdx[iPage],&pCur->info); - pCur->curFlags |= BTCF_ValidNKey; - }else{ - assertCellInfo(pCur); - } - } -#else /* if not _MSC_VER */ - /* Use a macro in all other compilers so that the function is inlined */ -#define getCellInfo(pCur) \ - if( pCur->info.nSize==0 ){ \ - int iPage = pCur->iPage; \ - btreeParseCell(pCur->apPage[iPage],pCur->aiIdx[iPage],&pCur->info); \ - pCur->curFlags |= BTCF_ValidNKey; \ - }else{ \ - assertCellInfo(pCur); \ +static SQLITE_NOINLINE void getCellInfo(BtCursor *pCur){ + if( pCur->info.nSize==0 ){ + int iPage = pCur->iPage; + pCur->curFlags |= BTCF_ValidNKey; + btreeParseCell(pCur->apPage[iPage],pCur->aiIdx[iPage],&pCur->info); + }else{ + assertCellInfo(pCur); } -#endif /* _MSC_VER */ +} #ifndef NDEBUG /* The next routine used only within assert() statements */ /*