From: drh Date: Wed, 17 Jun 2015 23:28:03 +0000 (+0000) Subject: Performance improvement in sqlite3VdbeMemShallowCopy() for the common X-Git-Tag: version-3.8.11~154 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14e067455e2b2dcd0a59c2370a2ea81a0c5f7750;p=thirdparty%2Fsqlite.git Performance improvement in sqlite3VdbeMemShallowCopy() for the common case where the receiver does not require prior resource deallocation. FossilOrigin-Name: d718ea36dce8cf1684c8bcda457fee87f8f8c4e2 --- diff --git a/manifest b/manifest index 5bc880ee3d..45aee8c584 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\sspacing\sand\scomment\sstyle\sfor\sthe\sshell.\s\sNo\schanges\sto\scode. -D 2015-06-17T18:57:37.637 +C Performance\simprovement\sin\ssqlite3VdbeMemShallowCopy()\sfor\sthe\scommon\ncase\swhere\sthe\sreceiver\sdoes\snot\srequire\sprior\sresource\sdeallocation. +D 2015-06-17T23:28:03.205 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 1063c58075b7400d93326b0eb332b48a54f53025 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -319,7 +319,7 @@ F src/vdbeInt.h 20295e482121d13437f69985f77db211cdc8bac1 F src/vdbeapi.c 6a0d7757987018ff6b1b81bc5293219cd26bb299 F src/vdbeaux.c 4c82d6f686f72ea7d266d26d528a171b728626f7 F src/vdbeblob.c 4f2e8e075d238392df98c5e03a64342465b03f90 -F src/vdbemem.c 15c5ca36201efc5a603e6eb3786e09bec08b9a64 +F src/vdbemem.c 4e947cd322bb531e3f7f6f58f0f536d182b38ef8 F src/vdbesort.c f5009e7a35e3065635d8918b9a31f498a499976b F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0 F src/vtab.c c535e80259ebe616467181a83a4263555b97c694 @@ -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 a7e27d19280048bcfff6d2e796eed72287b9dabe -R 10ec64cfc3a208bfe24294966a7ab6ac -U mistachkin -Z 7cf2fc34937c3a0e66c014198502d58b +P 5b547da00d131a494a6b348339af3d91dfa6e3b6 +R 8b11dda5b48978322f8411a0ee077b21 +U drh +Z c4d66c4cd049a599b9f894238778087c diff --git a/manifest.uuid b/manifest.uuid index 27a46f6c68..010a1bbb97 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5b547da00d131a494a6b348339af3d91dfa6e3b6 \ No newline at end of file +d718ea36dce8cf1684c8bcda457fee87f8f8c4e2 \ No newline at end of file diff --git a/src/vdbemem.c b/src/vdbemem.c index 16054ce7f9..1076812609 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -777,10 +777,15 @@ void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){ ** pFrom->z is used, then pTo->z points to the same thing as pFrom->z ** and flags gets srcType (either MEM_Ephem or MEM_Static). */ +static SQLITE_NOINLINE void vdbeClrCopy(Mem *pTo, const Mem *pFrom, int eType){ + vdbeMemClearExternAndSetNull(pTo); + assert( !VdbeMemDynamic(pTo) ); + sqlite3VdbeMemShallowCopy(pTo, pFrom, eType); +} void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){ assert( (pFrom->flags & MEM_RowSet)==0 ); assert( pTo->db==pFrom->db ); - if( VdbeMemDynamic(pTo) ) vdbeMemClearExternAndSetNull(pTo); + if( VdbeMemDynamic(pTo) ){ vdbeClrCopy(pTo,pFrom,srcType); return; } memcpy(pTo, pFrom, MEMCELLSIZE); if( (pFrom->flags&MEM_Static)==0 ){ pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Ephem);