aboutsummaryrefslogtreecommitdiff
path: root/test/speedtest1.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/speedtest1.c')
-rw-r--r--test/speedtest1.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/speedtest1.c b/test/speedtest1.c
index 383f5809a..8589b1633 100644
--- a/test/speedtest1.c
+++ b/test/speedtest1.c
@@ -27,6 +27,7 @@ static const char zHelp[] =
" --stats Show statistics at the end\n"
" --testset T Run test-set T\n"
" --trace Turn on SQL tracing\n"
+ " --threads N Use up to N threads for sorting\n"
" --utf16be Set text encoding to UTF-16BE\n"
" --utf16le Set text encoding to UTF-16LE\n"
" --verify Run additional verification steps.\n"
@@ -1141,6 +1142,7 @@ int main(int argc, char **argv){
int nPCache = 0, szPCache = 0;/* --pcache configuration */
int nScratch = 0, szScratch=0;/* --scratch configuration */
int showStats = 0; /* True for --stats */
+ int nThread = 0; /* --threads value */
const char *zTSet = "main"; /* Which --testset torun */
int doTrace = 0; /* True for --trace */
const char *zEncoding = 0; /* --utf16be or --utf16le */
@@ -1225,6 +1227,9 @@ int main(int argc, char **argv){
zTSet = argv[++i];
}else if( strcmp(z,"trace")==0 ){
doTrace = 1;
+ }else if( strcmp(z,"threads")==0 ){
+ if( i>=argc-1 ) fatal_error("missing argument on %s\n", argv[i]);
+ nThread = integerValue(argv[++i]);
}else if( strcmp(z,"utf16le")==0 ){
zEncoding = "utf16le";
}else if( strcmp(z,"utf16be")==0 ){
@@ -1290,6 +1295,7 @@ int main(int argc, char **argv){
/* Set database connection options */
sqlite3_create_function(g.db, "random", 0, SQLITE_UTF8, 0, randomFunc, 0, 0);
if( doTrace ) sqlite3_trace(g.db, traceCallback, 0);
+ speedtest1_exec("PRAGMA threads=%d", nThread);
if( zKey ){
speedtest1_exec("PRAGMA key('%s')", zKey);
}