From: drh Date: Wed, 14 Dec 2016 11:14:13 +0000 (+0000) Subject: Three times faster sqlite3SrcListAppend() in the common case by avoiding the X-Git-Tag: version-3.16.0~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ac178b3d7f7db2dfdf0bd693cb36497fc6d57dd9;p=thirdparty%2Fsqlite.git Three times faster sqlite3SrcListAppend() in the common case by avoiding the call to sqlite3SrcListEnlarge() for the first allocation. FossilOrigin-Name: 0ea2762f1d8f6a93ae2ee3b7b835927a474c6f66 --- diff --git a/manifest b/manifest index 2934b2c6ef..26d50e31a5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\soptimization\sthat\sprevents\swriting\sfreelist\spages\sto\sthe\sjournal. -D 2016-12-14T10:30:12.405 +C Three\stimes\sfaster\ssqlite3SrcListAppend()\sin\sthe\scommon\scase\sby\savoiding\sthe\ncall\sto\ssqlite3SrcListEnlarge()\sfor\sthe\sfirst\sallocation. +D 2016-12-14T11:14:13.907 F Makefile.in 7639c6a09da11a9c7c6f2630fc981ee588d1072d F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da @@ -334,7 +334,7 @@ F src/btmutex.c bc87dd3b062cc26edfe79918de2200ccb8d41e73 F src/btree.c b2055dff0b94e03eaad48a760984a2d8e39244e6 F src/btree.h 2349a588abcd7e0c04f984e15c5c777b61637583 F src/btreeInt.h 10c4b77c2fb399580babbcc7cf652ac10dba796e -F src/build.c 178f16698cbcb43402c343a9413fe22c99ffee21 +F src/build.c 66bab5ee3998b1ebbea66ce0de60a82dcf497747 F src/callback.c 2e76147783386374bf01b227f752c81ec872d730 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/ctime.c 9f2296a4e5d26ebf0e0d95a0af4628f1ea694e7a @@ -1536,7 +1536,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P c7021960f5c070fb5c9db9e41b4000d3dc065f42 -R 29a5ab173feb9dcb847f7e97678fc3f9 +P 6aa9b26544cbd0b41115c5f127dcf9a286d17e2b +R 5c6f1d55f58a01899a13212bdf50e07f U drh -Z a1e79a7a1334afe1605804fa02a1d4f0 +Z b26cd3596202cf83d05f18857a98dc5b diff --git a/manifest.uuid b/manifest.uuid index e16b607041..1d21ba4de4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6aa9b26544cbd0b41115c5f127dcf9a286d17e2b \ No newline at end of file +0ea2762f1d8f6a93ae2ee3b7b835927a474c6f66 \ No newline at end of file diff --git a/src/build.c b/src/build.c index 0fe2032689..d613e3a9e4 100644 --- a/src/build.c +++ b/src/build.c @@ -3736,9 +3736,12 @@ SrcList *sqlite3SrcListAppend( pList = sqlite3DbMallocRawNN(db, sizeof(SrcList) ); if( pList==0 ) return 0; pList->nAlloc = 1; - pList->nSrc = 0; + pList->nSrc = 1; + memset(&pList->a[0], 0, sizeof(pList->a[0])); + pList->a[0].iCursor = -1; + }else{ + pList = sqlite3SrcListEnlarge(db, pList, 1, pList->nSrc); } - pList = sqlite3SrcListEnlarge(db, pList, 1, pList->nSrc); if( db->mallocFailed ){ sqlite3SrcListDelete(db, pList); return 0;