From: drh Date: Wed, 10 Aug 2016 01:43:30 +0000 (+0000) Subject: Performance optimization in the yy_find_shift_action() routine of the X-Git-Tag: version-3.15.0~152 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c83db9e4e1c0cba15effedb4bf5411653b5c9005;p=thirdparty%2Fsqlite.git Performance optimization in the yy_find_shift_action() routine of the Lemon-generated parser. FossilOrigin-Name: ba6663beefcc8060e6f3be6ab37c13fdbb08b7de --- diff --git a/manifest b/manifest index 850a297904..679af7eda6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sharmless\scompiler\swarning. -D 2016-08-09T21:01:52.333 +C Performance\soptimization\sin\sthe\syy_find_shift_action()\sroutine\sof\sthe\nLemon-generated\sparser. +D 2016-08-10T01:43:30.837 F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a @@ -1438,7 +1438,7 @@ F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/lemon.c 09a96bed19955697a5e20c49ad863ec2005815a2 -F tool/lempar.c 57ffa9852901f6abc45981f0d882f31d1ccb06c0 +F tool/lempar.c 321ebbf1c85ab5435434042590eca0616da24b3d F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862 F tool/logest.c 11346aa019e2e77a00902aa7d0cabd27bd2e8cca @@ -1510,7 +1510,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 14864f2b8470fe98dbd17f59963bf1be8d4962f9 -R 3c3d32515aedcf447480f55f3548a5e0 +P 9a5a4f6e3bc265fecf79a7f63d14abbf239da636 +R fb6cb5f47404a4ca8ae3044e53622029 U drh -Z 4951f1f9d58f89a54689c68080c6d7fb +Z 1ed24d5681cad4ee5c357b2d89914ae1 diff --git a/manifest.uuid b/manifest.uuid index a3c154d615..f5266c615d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9a5a4f6e3bc265fecf79a7f63d14abbf239da636 \ No newline at end of file +ba6663beefcc8060e6f3be6ab37c13fdbb08b7de \ No newline at end of file diff --git a/tool/lempar.c b/tool/lempar.c index e0d0e88565..74906ae17f 100644 --- a/tool/lempar.c +++ b/tool/lempar.c @@ -450,50 +450,47 @@ static unsigned int yy_find_shift_action( assert( stateno <= YY_SHIFT_COUNT ); do{ i = yy_shift_ofst[stateno]; - if( i==YY_SHIFT_USE_DFLT ) return yy_default[stateno]; assert( iLookAhead!=YYNOCODE ); i += iLookAhead; if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ - if( iLookAhead>0 ){ #ifdef YYFALLBACK - YYCODETYPE iFallback; /* Fallback token */ - if( iLookAhead %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); - } -#endif - assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ - iLookAhead = iFallback; - continue; + if( yyTraceFILE ){ + fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", + yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); } +#endif + assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ + iLookAhead = iFallback; + continue; + } #endif #ifdef YYWILDCARD - { - int j = i - iLookAhead + YYWILDCARD; - if( + { + int j = i - iLookAhead + YYWILDCARD; + if( #if YY_SHIFT_MIN+YYWILDCARD<0 - j>=0 && + j>=0 && #endif #if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT - j0 + ){ #ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], - yyTokenName[YYWILDCARD]); - } -#endif /* NDEBUG */ - return yy_action[j]; + if( yyTraceFILE ){ + fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", + yyTracePrompt, yyTokenName[iLookAhead], + yyTokenName[YYWILDCARD]); } +#endif /* NDEBUG */ + return yy_action[j]; } -#endif /* YYWILDCARD */ } +#endif /* YYWILDCARD */ return yy_default[stateno]; }else{ return yy_action[i];