Snapshot of upstream SQLite 3.42.0
[sqlcipher.git] / test / json / json-speed-check.sh
blobf7e7f1be58f7a13578001574a27004d95fbc8c58
1 #!/bin/bash
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
11 # the first argument:
13 # summary-$BASE.txt # Copy of standard output
14 # jout-$BASE.txt # cachegrind output
15 # explain-$BASE.txt # EXPLAIN listings (only with --explain)
17 if test "$1" = ""
18 then
19 echo "Usage: $0 OUTPUTFILE [OPTIONS]"
20 exit
22 NAME=$1
23 shift
24 #CC_OPTS="-DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_MEMSYS5"
25 CC_OPTS="-DSQLITE_ENABLE_MEMSYS5"
26 CC=gcc
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"
37 BASELINE="trunk"
38 doExplain=0
39 doCachegrind=1
40 doVdbeProfile=0
41 doWal=1
42 doDiff=1
43 while test "$1" != ""; do
44 case $1 in
45 --nodiff)
46 doDiff=0
48 --lean)
49 CC_OPTS="$CC_OPTS $LEAN_OPTS"
51 --clang)
52 CC=clang
54 --gcc7)
55 CC=gcc-7
57 -*)
58 CC_OPTS="$CC_OPTS $1"
61 BASELINE=$1
63 esac
64 shift
65 done
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