Add the --mmap option to the speedtest1 program and to the speed-check.sh

script that is frequently used to run speedtest1.

FossilOrigin-Name: 1a636d5e0eec0a4d968519d1dfd35a983e512c78
This commit is contained in:
drh 2016-12-12 23:24:08 +00:00
parent 2a70254f74
commit 26f419800a
4 changed files with 22 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Remove\sunnecessary\sMemPage\sinitialization\sresets\sin\sthe\sautovacuum\sptrmap\nprocessing.
D 2016-12-12T18:12:03.591
C Add\sthe\s--mmap\soption\sto\sthe\sspeedtest1\sprogram\sand\sto\sthe\sspeed-check.sh\nscript\sthat\sis\sfrequently\sused\sto\srun\sspeedtest1.
D 2016-12-12T23:24:08.261
F Makefile.in 7639c6a09da11a9c7c6f2630fc981ee588d1072d
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
@ -1122,7 +1122,7 @@ F test/speed3.test 694affeb9100526007436334cf7d08f3d74b85ef
F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
F test/speedtest1.c dae4b22c620743e2767d0ec9fc11f2d1d6383ff1
F test/speedtest1.c 0c92fd0db4cb778e3b6968db0ea859e28f077823
F test/spellfix.test f9c1f431e2c096c8775fec032952320c0e4700db
F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33
@ -1496,7 +1496,7 @@ F tool/showstat4.c b14159aa062f661b394ba37b6b7b94bfb8012ab9
F tool/showwal.c ec79959834f7b21f1e0a2aa52bb7c056d2203977
F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
F tool/spaceanal.tcl ab7d9bf68062907282a64b3e12ccbfad47193c5a
F tool/speed-check.sh b7922d000d66339d5242e7ba47ba6e3f1bc9a538
F tool/speed-check.sh e6ca0695b047af64201ebe0ef452e423f55d78b1
F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355
F tool/speedtest16.c ecb6542862151c3e6509bbc00509b234562ae81e
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
@ -1536,7 +1536,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 9675518b33e8d40769daefb860dc748113f750b6
R 5c1b605906a01e86141edb10d66002b4
P 1b36fbb9f05f3a5844e198b489bff36ef6cd908c
R 54a6c1795de20385060d3d26915836b2
U drh
Z 43d64d3ee0d93b0119909f8d75d1fdb9
Z 47f248a7928b3840fe2e23a9066d59e9

View File

@ -1 +1 @@
1b36fbb9f05f3a5844e198b489bff36ef6cd908c
1a636d5e0eec0a4d968519d1dfd35a983e512c78

View File

@ -15,6 +15,7 @@ static const char zHelp[] =
" --journal M Set the journal_mode to M\n"
" --key KEY Set the encryption key to KEY\n"
" --lookaside N SZ Configure lookaside for N slots of SZ bytes each\n"
" --mmap SZ MMAP the first SZ bytes of the database file\n"
" --multithread Set multithreaded mode\n"
" --nomemstat Disable memory statistics\n"
" --nosync Set PRAGMA synchronous=OFF\n"
@ -1381,6 +1382,7 @@ int main(int argc, char **argv){
int nScratch = 0, szScratch=0;/* --scratch configuration */
int showStats = 0; /* True for --stats */
int nThread = 0; /* --threads value */
int mmapSize = 0; /* How big of a memory map to use */
const char *zTSet = "main"; /* Which --testset torun */
int doTrace = 0; /* True for --trace */
const char *zEncoding = 0; /* --utf16be or --utf16le */
@ -1443,6 +1445,11 @@ int main(int argc, char **argv){
}else if( strcmp(z,"nomemstat")==0 ){
sqlite3_config(SQLITE_CONFIG_MEMSTATUS, 0);
#endif
#if SQLITE_VERSION_NUMBER>=3007017
}else if( strcmp(z, "mmap")==0 ){
if( i>=argc-1 ) fatal_error("missing argument on %s\n", argv[i]);
mmapSize = integerValue(argv[++i]);
#endif
}else if( strcmp(z,"nosync")==0 ){
noSync = 1;
}else if( strcmp(z,"notnull")==0 ){
@ -1573,6 +1580,9 @@ int main(int argc, char **argv){
#ifndef SQLITE_OMIT_DEPRECATED
if( doTrace ) sqlite3_trace(g.db, traceCallback, 0);
#endif
if( mmapSize>0 ){
speedtest1_exec("PRAGMA mmap_size=%d", mmapSize);
}
speedtest1_exec("PRAGMA threads=%d", nThread);
if( zKey ){
speedtest1_exec("PRAGMA key('%s')", zKey);

View File

@ -90,6 +90,10 @@ while test "$1" != ""; do
shift;
SPEEDTEST_OPTS="$SPEEDTEST_OPTS --repeat $1"
;;
--mmap)
shift;
SPEEDTEST_OPTS="$SPEEDTEST_OPTS --mmap $1"
;;
*)
CC_OPTS="$CC_OPTS $1"
;;