interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / test / json / json-speed-check.sh

87 lines · 2569 bytes Raw Blame History
1#!/bin/bash
2#
3# This is a template for a script used for day-to-day size and
4# performance monitoring of SQLite. Typical usage:
5#
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 changes
9#
10# There are multiple output files, all with a base name given by
11# the first argument:
12#
13# summary-$BASE.txt # Copy of standard output
14# jout-$BASE.txt # cachegrind output
15# explain-$BASE.txt # EXPLAIN listings (only with --explain)
16#
17if test "$1" = ""
18then
19 echo "Usage: $0 OUTPUTFILE [OPTIONS]"
20 exit
21fi
22NAME=$1
23shift
24#CC_OPTS="-DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_MEMSYS5"
25CC_OPTS="-DSQLITE_ENABLE_MEMSYS5"
26CC=gcc
27LEAN_OPTS="-DSQLITE_THREADSAFE=0"
28LEAN_OPTS="$LEAN_OPTS -DSQLITE_DEFAULT_MEMSTATUS=0"
29LEAN_OPTS="$LEAN_OPTS -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1"
30LEAN_OPTS="$LEAN_OPTS -DSQLITE_LIKE_DOESNT_MATCH_BLOBS"
31LEAN_OPTS="$LEAN_OPTS -DSQLITE_MAX_EXPR_DEPTH=0"
32LEAN_OPTS="$LEAN_OPTS -DSQLITE_OMIT_DECLTYPE"
33LEAN_OPTS="$LEAN_OPTS -DSQLITE_OMIT_DEPRECATED"
34LEAN_OPTS="$LEAN_OPTS -DSQLITE_OMIT_PROGRESS_CALLBACK"
35LEAN_OPTS="$LEAN_OPTS -DSQLITE_OMIT_SHARED_CACHE"
36LEAN_OPTS="$LEAN_OPTS -DSQLITE_USE_ALLOCA"
37BASELINE="trunk"
38TYPE="json"
39doExplain=0
40doCachegrind=1
41doVdbeProfile=0
42doWal=1
43doDiff=1
44doJsonB=0
45while test "$1" != ""; do
46 case $1 in
47 --nodiff)
48 doDiff=0
49 ;;
50 --lean)
51 CC_OPTS="$CC_OPTS $LEAN_OPTS"
52 ;;
53 --clang)
54 CC=clang
55 ;;
56 --gcc7)
57 CC=gcc-7
58 ;;
59 --jsonb)
60 doJsonB=1
61 TYPE="jsonb"
62 ;;
63 -*)
64 CC_OPTS="$CC_OPTS $1"
65 ;;
66 *)
67 BASELINE=$1
68 ;;
69 esac
70 shift
71done
72echo "NAME = $NAME" | tee summary-$NAME.txt
73echo "CC_OPTS = $CC_OPTS" | tee -a summary-$NAME.txt
74rm -f cachegrind.out.* jsonshell
75$CC -g -Os -Wall -I. $CC_OPTS ./shell.c ./sqlite3.c -o jsonshell -lm -ldl -lpthread
76ls -l jsonshell | tee -a summary-$NAME.txt
77home=`echo $0 | sed -e 's,/[^/]*$,,'`
78DB=$TYPE''100mb.db
79echo ./jsonshell $DB "<$home/$TYPE-q1.txt"
80valgrind --tool=cachegrind ./jsonshell json100mb_b.db <$home/$TYPE-q1.txt \
81 2>&1 | tee -a summary-$NAME.txt
82cg_anno.tcl cachegrind.out.* >$TYPE-$NAME.txt
83echo '*****************************************************' >>$TYPE-$NAME.txt
84sed 's/^[0-9=-]\{9\}/==00000==/' summary-$NAME.txt >>$TYPE-$NAME.txt
85if test "$NAME" != "$BASELINE" -a $doDiff -ne 0; then
86 fossil xdiff --tk -c 20 $TYPE-$BASELINE.txt $TYPE-$NAME.txt
87fi