Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/test/json/json-speed-check.sh # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers 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 # 17 if test "$1" = "" 18 then 19 echo "Usage: $0 OUTPUTFILE [OPTIONS]" 20 exit 21 fi 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 TYPE="json" 39 doExplain=0 40 doCachegrind=1 41 doVdbeProfile=0 42 doWal=1 43 doDiff=1 44 doJsonB=0 45 while 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 71 done 72 echo "NAME = $NAME" | tee summary-$NAME.txt 73 echo "CC_OPTS = $CC_OPTS" | tee -a summary-$NAME.txt 74 rm -f cachegrind.out.* jsonshell 75 $CC -g -Os -Wall -I. $CC_OPTS ./shell.c ./sqlite3.c -o jsonshell -lm -ldl -lpthread 76 ls -l jsonshell | tee -a summary-$NAME.txt 77 home=`echo $0 | sed -e 's,/[^/]*$,,'` 78 DB=$TYPE''100mb.db 79 echo ./jsonshell $DB "<$home/$TYPE-q1.txt" 80 valgrind --tool=cachegrind ./jsonshell json100mb_b.db <$home/$TYPE-q1.txt \ 81 2>&1 | tee -a summary-$NAME.txt 82 cg_anno.tcl cachegrind.out.* >$TYPE-$NAME.txt 83 echo '*****************************************************' >>$TYPE-$NAME.txt 84 sed 's/^[0-9=-]\{9\}/==00000==/' summary-$NAME.txt >>$TYPE-$NAME.txt 85 if test "$NAME" != "$BASELINE" -a $doDiff -ne 0; then 86 fossil xdiff --tk -c 20 $TYPE-$BASELINE.txt $TYPE-$NAME.txt 87 fi