/ Check-in [7785b3a2]
Login

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

Overview
Comment:Fix speedtest1.c so that it works with SQLITE_OMIT_DEPRECATED. Add the --lean and --cachesize options to speed-check.sh.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7785b3a25778cc19861c01f4148f72e0f724f55d
User & Date: drh 2016-09-21 23:58:49
Context
2016-09-22
18:46
Makefile changes to support building winsqlite3.dll using STDCALL rather than CDECL. check-in: 5e892d60 user: mistachkin tags: trunk
2016-09-21
23:58
Fix speedtest1.c so that it works with SQLITE_OMIT_DEPRECATED. Add the --lean and --cachesize options to speed-check.sh. check-in: 7785b3a2 user: drh tags: trunk
19:43
Fix a problem with the fts5 auxiliary function API causing a crash when a query contained a phrase of zero terms. check-in: 0741812d user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/speedtest1.c.

   417    417   #endif
   418    418     {
   419    419       sqlite3_reset(g.pStmt);
   420    420     }
   421    421     speedtest1_shrink_memory();
   422    422   }
   423    423   
          424  +#ifndef SQLITE_OMIT_DEPRECATED
   424    425   /* The sqlite3_trace() callback function */
   425    426   static void traceCallback(void *NotUsed, const char *zSql){
   426    427     int n = (int)strlen(zSql);
   427    428     while( n>0 && (zSql[n-1]==';' || ISSPACE(zSql[n-1])) ) n--;
   428    429     fprintf(stderr,"%.*s;\n", n, zSql);
   429    430   }
          431  +#endif /* SQLITE_OMIT_DEPRECATED */
   430    432   
   431    433   /* Substitute random() function that gives the same random
   432    434   ** sequence on each run, for repeatability. */
   433    435   static void randomFunc(
   434    436     sqlite3_context *context,
   435    437     int NotUsed,
   436    438     sqlite3_value **NotUsed2
................................................................................
  1412   1414       rc = sqlite3_db_config(g.db, SQLITE_DBCONFIG_LOOKASIDE, pLook, szLook,nLook);
  1413   1415       if( rc ) fatal_error("lookaside configuration failed: %d\n", rc);
  1414   1416     }
  1415   1417   #endif
  1416   1418   
  1417   1419     /* Set database connection options */
  1418   1420     sqlite3_create_function(g.db, "random", 0, SQLITE_UTF8, 0, randomFunc, 0, 0);
         1421  +#ifndef SQLITE_OMIT_DEPRECATED
  1419   1422     if( doTrace ) sqlite3_trace(g.db, traceCallback, 0);
         1423  +#endif
  1420   1424     speedtest1_exec("PRAGMA threads=%d", nThread);
  1421   1425     if( zKey ){
  1422   1426       speedtest1_exec("PRAGMA key('%s')", zKey);
  1423   1427     }
  1424   1428     if( zEncoding ){
  1425   1429       speedtest1_exec("PRAGMA encoding=%s", zEncoding);
  1426   1430     }

Changes to tool/speed-check.sh.

    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 -DSQLITE_ENABLE_MEMSYS5"
    25         -SPEEDTEST_OPTS="--shrink-memory --reprepare --heap 10000000 64"
           24  +#CC_OPTS="-DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_MEMSYS5"
           25  +CC_OPTS="-DSQLITE_ENABLE_MEMSYS5"
           26  +SPEEDTEST_OPTS="--shrink-memory --reprepare --stats --heap 10000000 64"
    26     27   SIZE=5
           28  +LEAN_OPTS="-DSQLITE_THREADSAFE=0"
           29  +LEAN_OPTS="$LEAN_OPTS -DSQLITE_DEFAULT_MEMSTATUS=0"
           30  +LEAN_OPTS="$LEAN_OPTS -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1"
           31  +LEAN_OPTS="$LEAN_OPTS -DSQLITE_LIKE_DOESNT_MATCH_BLOB"
           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"
    27     36   doExplain=0
    28     37   doCachegrind=1
    29     38   while test "$1" != ""; do
    30     39     case $1 in
    31     40       --reprepare)
    32     41           SPEEDTEST_OPTS="$SPEEDTEST_OPTS $1"
    33     42           ;;
................................................................................
    51     60           ;;
    52     61       --wal)
    53     62           SPEEDTEST_OPTS="$SPEEDTEST_OPTS --journal wal"
    54     63           ;;
    55     64       --size)
    56     65           shift; SIZE=$1
    57     66           ;;
           67  +    --cachesize)
           68  +        shift; SPEEDTEST_OPTS="$SPEEDTEST_OPTS --cachesize $1"
           69  +        ;;
    58     70       --explain)
    59     71           doExplain=1
    60     72           ;;
    61     73       --vdbeprofile)
    62     74           rm -f vdbe_profile.out
    63     75           CC_OPTS="$CC_OPTS -DVDBE_PROFILE"
    64     76           doCachegrind=0
    65     77           ;;
           78  +    --lean)
           79  +        CC_OPTS="$CC_OPTS $LEAN_OPTS"
           80  +        ;;
    66     81       --heap)
    67     82           CC_OPTS="$CC_OPTS -DSQLITE_ENABLE_MEMSYS5"
    68     83           shift;
    69     84           SPEEDTEST_OPTS="$SPEEDTEST_OPTS --heap $1 64"
    70     85           ;;
    71     86       *)
    72     87           CC_OPTS="$CC_OPTS $1"