/ Check-in [e4bee561]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improvements to the performance testing program "speedtest1.c" and the shell script that invokes it.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e4bee561fdead5d35c24da3fe8a11bf6548550c6
User & Date: drh 2016-03-30 12:20:24
Context
2016-03-30
13:43
Incorporate the sessions extension and the SQLITE_ENABLE_PREUPDATE_HOOK compile-time option. check-in: 4af7a90f user: drh tags: trunk
12:20
Improvements to the performance testing program "speedtest1.c" and the shell script that invokes it. check-in: e4bee561 user: drh tags: trunk
2016-03-29
10:14
Version 3.12.0 check-in: e9bb4cf4 user: drh tags: trunk, release, version-3.12.0
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/speedtest1.c.

  1232   1232     void *pPCache = 0;            /* Allocated storage for pcache */
  1233   1233     void *pScratch = 0;           /* Allocated storage for scratch */
  1234   1234     int iCur, iHi;                /* Stats values, current and "highwater" */
  1235   1235     int i;                        /* Loop counter */
  1236   1236     int rc;                       /* API return code */
  1237   1237   
  1238   1238     /* Display the version of SQLite being tested */
  1239         -  printf("Speedtest1 for SQLite %s %.50s\n", sqlite3_libversion(), sqlite3_sourceid());
         1239  +  printf("-- Speedtest1 for SQLite %s %.50s\n",
         1240  +         sqlite3_libversion(), sqlite3_sourceid());
  1240   1241   
  1241   1242     /* Process command-line arguments */
  1242   1243     g.zWR = "";
  1243   1244     g.zNN = "";
  1244   1245     g.zPK = "UNIQUE";
  1245   1246     g.szTest = 100;
  1246   1247     for(i=1; i<argc; i++){

Changes to tool/run-speed-test.sh.

     8      8   #     fossil test-diff --tk cout-trunk.txt cout-x1.txt   # View chanages
     9      9   #
    10     10   # There are multiple output files, all with a base name given by
    11     11   # the first argument:
    12     12   #
    13     13   #     summary-$BASE.txt           # Copy of standard output
    14     14   #     cout-$BASE.txt              # cachegrind output
    15         -#     explain-$BASE.txt           # EXPLAIN listings
           15  +#     explain-$BASE.txt           # EXPLAIN listings (only with --explain)
    16     16   #
    17     17   if test "$1" = ""
    18     18   then
    19     19     echo "Usage: $0 OUTPUTFILE [OPTIONS]"
    20     20     exit
    21     21   fi
    22     22   NAME=$1
    23     23   shift
    24         -CC_OPTS="-DSQLITE_ENABLE_RTREE"
    25         -SPEEDTEST_OPTS="--shrink-memory --reprepare"
           24  +CC_OPTS="-DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_MEMSYS5"
           25  +SPEEDTEST_OPTS="--shrink-memory --reprepare --heap 10000000 64"
    26     26   SIZE=5
           27  +doExplain=0
    27     28   while test "$1" != ""; do
    28     29     case $1 in
    29     30       --reprepare)
    30     31           SPEEDTEST_OPTS="$SPEEDTEST_OPTS $1"
    31     32           ;;
    32     33       --autovacuum)
    33     34           SPEEDTEST_OPTS="$SPEEDTEST_OPTS $1"
    34     35           ;;
    35     36       --utf16be)
    36     37           SPEEDTEST_OPTS="$SPEEDTEST_OPTS $1"
    37     38           ;;
           39  +    --stats)
           40  +        SPEEDTEST_OPTS="$SPEEDTEST_OPTS $1"
           41  +        ;;
    38     42       --without-rowid)
    39     43           SPEEDTEST_OPTS="$SPEEDTEST_OPTS $1"
    40     44           ;;
           45  +    --nomemstat)
           46  +        SPEEDTEST_OPTS="$SPEEDTEST_OPTS $1"
           47  +        ;;
           48  +    --wal)
           49  +        SPEEDTEST_OPTS="$SPEEDTEST_OPTS --journal wal"
           50  +        ;;
    41     51       --size)
    42     52           shift; SIZE=$1
    43     53           ;;
           54  +    --explain)
           55  +        doExplain=1
           56  +        ;;
           57  +    --heap)
           58  +        CC_OPTS="$CC_OPTS -DSQLITE_ENABLE_MEMSYS5"
           59  +        shift;
           60  +        SPEEDTEST_OPTS="$SPEEDTEST_OPTS --heap $1 64"
           61  +        ;;
    44     62       *)
    45     63           CC_OPTS="$CC_OPTS $1"
    46     64           ;;
    47     65     esac
    48     66     shift
    49     67   done
    50     68   SPEEDTEST_OPTS="$SPEEDTEST_OPTS --size $SIZE"
    51     69   echo "NAME           = $NAME" | tee summary-$NAME.txt
    52     70   echo "SPEEDTEST_OPTS = $SPEEDTEST_OPTS" | tee -a summary-$NAME.txt
    53     71   echo "CC_OPTS        = $CC_OPTS" | tee -a summary-$NAME.txt
    54     72   rm -f cachegrind.out.* speedtest1 speedtest1.db sqlite3.o
    55     73   gcc -g -Os -Wall -I. $CC_OPTS -c sqlite3.c
    56     74   size sqlite3.o | tee -a summary-$NAME.txt
    57         -gcc -g -Os -Wall -I. $CC_OPTS \
    58         -   -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
    59         -   ./shell.c ./sqlite3.c -o sqlite3 -ldl -lpthread
           75  +if test $doExplain -eq 1; then
           76  +  gcc -g -Os -Wall -I. $CC_OPTS \
           77  +     -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
           78  +    ./shell.c ./sqlite3.c -o sqlite3 -ldl -lpthread
           79  +fi
    60     80   SRC=./speedtest1.c
    61     81   gcc -g -Os -Wall -I. $CC_OPTS $SRC ./sqlite3.o -o speedtest1 -ldl -lpthread
    62     82   ls -l speedtest1 | tee -a summary-$NAME.txt
    63     83   valgrind --tool=cachegrind ./speedtest1 speedtest1.db \
    64     84       $SPEEDTEST_OPTS 2>&1 | tee -a summary-$NAME.txt
    65     85   size sqlite3.o | tee -a summary-$NAME.txt
    66     86   wc sqlite3.c
    67     87   cg_anno.tcl cachegrind.out.* >cout-$NAME.txt
    68         -./speedtest1 --explain $SPEEDTEST_OPTS | ./sqlite3 >explain-$NAME.txt
           88  +if test $doExplain -eq 1; then
           89  +  ./speedtest1 --explain $SPEEDTEST_OPTS | ./sqlite3 >explain-$NAME.txt
           90  +fi