3 # This is a template for a script used for day-to-day size and
4 # performance monitoring of SQLite. Typical usage:
6 # sh speed-check.sh trunk # Baseline measurement of trunk
7 # sh speed-check.sh x1 # Measure some experimental change
8 # fossil xdiff --tk jout-trunk.txt jout-x1.txt # View chanages
10 # There are multiple output files, all with a base name given by
13 # summary-$BASE.txt # Copy of standard output
14 # jout-$BASE.txt # cachegrind output
15 # explain-$BASE.txt # EXPLAIN listings (only with --explain)
19 echo "Usage: $0 OUTPUTFILE [OPTIONS]"
24 #CC_OPTS="-DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_MEMSYS5"
25 CC_OPTS
="-DSQLITE_ENABLE_MEMSYS5"
27 LEAN_OPTS
="-DSQLITE_THREADSAFE=0"
28 LEAN_OPTS
="$LEAN_OPTS -DSQLITE_DEFAULT_MEMSTATUS=0"
29 LEAN_OPTS
="$LEAN_OPTS -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1"
30 LEAN_OPTS
="$LEAN_OPTS -DSQLITE_LIKE_DOESNT_MATCH_BLOBS"
31 LEAN_OPTS
="$LEAN_OPTS -DSQLITE_MAX_EXPR_DEPTH=0"
32 LEAN_OPTS
="$LEAN_OPTS -DSQLITE_OMIT_DECLTYPE"
33 LEAN_OPTS
="$LEAN_OPTS -DSQLITE_OMIT_DEPRECATED"
34 LEAN_OPTS
="$LEAN_OPTS -DSQLITE_OMIT_PROGRESS_CALLBACK"
35 LEAN_OPTS
="$LEAN_OPTS -DSQLITE_OMIT_SHARED_CACHE"
36 LEAN_OPTS
="$LEAN_OPTS -DSQLITE_USE_ALLOCA"
43 while test "$1" != ""; do
49 CC_OPTS
="$CC_OPTS $LEAN_OPTS"
66 echo "NAME = $NAME" |
tee summary-
$NAME.txt
67 echo "CC_OPTS = $CC_OPTS" |
tee -a summary-
$NAME.txt
68 rm -f cachegrind.out.
* jsonshell
69 $CC -g -Os -Wall -I.
$CC_OPTS .
/shell.c .
/sqlite3.c
-o jsonshell
-ldl -lpthread
70 ls -l jsonshell |
tee -a summary-
$NAME.txt
71 home
=`echo $0 | sed -e 's,/[^/]*$,,'`
72 echo .
/jsonshell json100mb.db
"<$home/json-q1.txt"
73 valgrind
--tool=cachegrind .
/jsonshell json100mb.db
<$home/json-q1.txt \
74 2>&1 |
tee -a summary-
$NAME.txt
75 cg_anno.tcl cachegrind.out.
* >jout-
$NAME.txt
76 echo '*****************************************************' >>jout-
$NAME.txt
77 sed 's/^[0-9=-]\{9\}/==00000==/' summary-
$NAME.txt
>>jout-
$NAME.txt
78 if test "$NAME" != "$BASELINE"; then
79 fossil xdiff
--tk -c 20 jout-
$BASELINE.txt jout-
$NAME.txt