Fix speedtest1.c so that it works with SQLITE_OMIT_DEPRECATED.

Add the --lean and --cachesize options to speed-check.sh.

FossilOrigin-Name: 7785b3a25778cc19861c01f4148f72e0f724f55d
This commit is contained in:
drh 2016-09-21 23:58:49 +00:00
parent 49377a8fb7
commit 98ef26b0d4
4 changed files with 30 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C Fix\sa\sproblem\swith\sthe\sfts5\sauxiliary\sfunction\sAPI\scausing\sa\scrash\swhen\sa\squery\scontained\sa\sphrase\sof\szero\sterms.
D 2016-09-21T19:43:34.002
C Fix\sspeedtest1.c\sso\sthat\sit\sworks\swith\sSQLITE_OMIT_DEPRECATED.\nAdd\sthe\s--lean\sand\s--cachesize\soptions\sto\sspeed-check.sh.
D 2016-09-21T23:58:49.145
F Makefile.in 6fd48ffcf7c2deea7499062d1f3747f986c19678
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc e1aa788e84f926e42239ee167c53f785bedacacd
@ -1112,7 +1112,7 @@ F test/speed3.test 694affeb9100526007436334cf7d08f3d74b85ef
F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
F test/speedtest1.c 28221f433d358dd3fcf2ca504ed51409aa66ffaf
F test/speedtest1.c 43b25ae8e303bcada98e00be036e710de17d346a
F test/spellfix.test f9c1f431e2c096c8775fec032952320c0e4700db
F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33
@ -1485,7 +1485,7 @@ F tool/showstat4.c bda40d6e395df7edb6e9ea630784d3d762c35b4b
F tool/showwal.c ec79959834f7b21f1e0a2aa52bb7c056d2203977
F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
F tool/spaceanal.tcl 85d90e6674d8298e3eaf82dbcef3abc2d5317f3e
F tool/speed-check.sh 45d3bf861b009993ff401f0d00e34a4cc937fce4
F tool/speed-check.sh b6f8540db91bfd1fcfb53646bf657cf53ee03cd0
F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355
F tool/speedtest16.c ecb6542862151c3e6509bbc00509b234562ae81e
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
@ -1525,7 +1525,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 4a613d856433ac48e8ee0cd7f0e774e484e8acf6
R b3b313c63559d3f43c5fcc9e87b2dba1
U dan
Z ee8b7750ac92f9eff66f8bc864927c4a
P 0741812d7fcd558479e4849fbb3ba8d03738d018
R cbecff860fb3e1e414a3a9d25ae007ae
U drh
Z 82b45269186e0ae095502a5cdd8c1032

View File

@ -1 +1 @@
0741812d7fcd558479e4849fbb3ba8d03738d018
7785b3a25778cc19861c01f4148f72e0f724f55d

View File

@ -421,12 +421,14 @@ void speedtest1_run(void){
speedtest1_shrink_memory();
}
#ifndef SQLITE_OMIT_DEPRECATED
/* The sqlite3_trace() callback function */
static void traceCallback(void *NotUsed, const char *zSql){
int n = (int)strlen(zSql);
while( n>0 && (zSql[n-1]==';' || ISSPACE(zSql[n-1])) ) n--;
fprintf(stderr,"%.*s;\n", n, zSql);
}
#endif /* SQLITE_OMIT_DEPRECATED */
/* Substitute random() function that gives the same random
** sequence on each run, for repeatability. */
@ -1416,7 +1418,9 @@ int main(int argc, char **argv){
/* Set database connection options */
sqlite3_create_function(g.db, "random", 0, SQLITE_UTF8, 0, randomFunc, 0, 0);
#ifndef SQLITE_OMIT_DEPRECATED
if( doTrace ) sqlite3_trace(g.db, traceCallback, 0);
#endif
speedtest1_exec("PRAGMA threads=%d", nThread);
if( zKey ){
speedtest1_exec("PRAGMA key('%s')", zKey);

View File

@ -21,9 +21,18 @@ then
fi
NAME=$1
shift
CC_OPTS="-DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_MEMSYS5"
SPEEDTEST_OPTS="--shrink-memory --reprepare --heap 10000000 64"
#CC_OPTS="-DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_MEMSYS5"
CC_OPTS="-DSQLITE_ENABLE_MEMSYS5"
SPEEDTEST_OPTS="--shrink-memory --reprepare --stats --heap 10000000 64"
SIZE=5
LEAN_OPTS="-DSQLITE_THREADSAFE=0"
LEAN_OPTS="$LEAN_OPTS -DSQLITE_DEFAULT_MEMSTATUS=0"
LEAN_OPTS="$LEAN_OPTS -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1"
LEAN_OPTS="$LEAN_OPTS -DSQLITE_LIKE_DOESNT_MATCH_BLOB"
LEAN_OPTS="$LEAN_OPTS -DSQLITE_OMIT_DECLTYPE"
LEAN_OPTS="$LEAN_OPTS -DSQLITE_OMIT_DEPRECATED"
LEAN_OPTS="$LEAN_OPTS -DSQLITE_OMIT_PROGRESS_CALLBACK"
LEAN_OPTS="$LEAN_OPTS -DSQLITE_OMIT_SHARED_CACHE"
doExplain=0
doCachegrind=1
while test "$1" != ""; do
@ -55,6 +64,9 @@ while test "$1" != ""; do
--size)
shift; SIZE=$1
;;
--cachesize)
shift; SPEEDTEST_OPTS="$SPEEDTEST_OPTS --cachesize $1"
;;
--explain)
doExplain=1
;;
@ -63,6 +75,9 @@ while test "$1" != ""; do
CC_OPTS="$CC_OPTS -DVDBE_PROFILE"
doCachegrind=0
;;
--lean)
CC_OPTS="$CC_OPTS $LEAN_OPTS"
;;
--heap)
CC_OPTS="$CC_OPTS -DSQLITE_ENABLE_MEMSYS5"
shift;