diff options
author | drh <> | 2025-04-10 19:39:34 +0000 |
---|---|---|
committer | drh <> | 2025-04-10 19:39:34 +0000 |
commit | f95e964b6b94a26f7ecc1a9fde947384107c4d2d (patch) | |
tree | 12640f628c0f16d1ec4da30279a074ed03c24e30 /test | |
parent | e4856e86cda3f40deeecc519f41b4daf78846c22 (diff) | |
download | sqlite-f95e964b6b94a26f7ecc1a9fde947384107c4d2d.tar.gz sqlite-f95e964b6b94a26f7ecc1a9fde947384107c4d2d.zip |
Provide new command-line options --hard-heap-limit and --soft-heap-limit
for speedtest1.
FossilOrigin-Name: 578e9fedeaaacd152ae1988920e6c9a0c43f664e2f9461c0994ba427ae1688e7
Diffstat (limited to 'test')
-rw-r--r-- | test/speedtest1.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/speedtest1.c b/test/speedtest1.c index 3dce5942b..4a383e2e6 100644 --- a/test/speedtest1.c +++ b/test/speedtest1.c @@ -35,6 +35,7 @@ static const char zHelp[] = " --exclusive Enable locking_mode=EXCLUSIVE\n" " --explain Like --sqlonly but with added EXPLAIN keywords\n" " --fullfsync Enable fullfsync=TRUE\n" + " --hard-heap-limit N The hard limit on the maximum heap size\n" " --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n" " --incrvacuum Enable incremenatal vacuum mode\n" " --journal M Set the journal_mode to M\n" @@ -60,6 +61,7 @@ static const char zHelp[] = " --sqlonly No-op. Only show the SQL that would have been run.\n" " --shrink-memory Invoke sqlite3_db_release_memory() frequently.\n" " --size N Relative test size. Default=100\n" + " --soft-heap-limit N The soft limit on the maximum heap size\n" " --strict Use STRICT table where appropriate\n" " --stats Show statistics at the end\n" " --stmtscanstatus Activate SQLITE_DBCONFIG_STMT_SCANSTATUS\n" @@ -2961,6 +2963,8 @@ int main(int argc, char **argv){ int doIncrvac = 0; /* True for --incrvacuum */ const char *zJMode = 0; /* Journal mode */ const char *zKey = 0; /* Encryption key */ + int nHardHeapLmt = 0; /* The hard heap limit */ + int nSoftHeapLmt = 0; /* The soft heap limit */ int nLook = -1, szLook = 0; /* --lookaside configuration */ int noSync = 0; /* True for --nosync */ int pageSize = 0; /* Desired page size. 0 means default */ @@ -3033,6 +3037,10 @@ int main(int argc, char **argv){ }else if( strcmp(z,"explain")==0 ){ g.bSqlOnly = 1; g.bExplain = 1; + }else if( strcmp(z,"hard-heap-limit")==0 ){ + ARGC_VALUE_CHECK(1); + nHardHeapLmt = integerValue(argv[i+1]); + i += 1; }else if( strcmp(z,"heap")==0 ){ ARGC_VALUE_CHECK(2); nHeap = integerValue(argv[i+1]); @@ -3122,6 +3130,10 @@ int main(int argc, char **argv){ }else if( strcmp(z,"size")==0 ){ ARGC_VALUE_CHECK(1); g.szTest = g.szBase = integerValue(argv[++i]); + }else if( strcmp(z,"soft-heap-limit")==0 ){ + ARGC_VALUE_CHECK(1); + nSoftHeapLmt = integerValue(argv[i+1]); + i += 1; }else if( strcmp(z,"stats")==0 ){ showStats = 1; }else if( strcmp(z,"temp")==0 ){ @@ -3283,6 +3295,15 @@ int main(int argc, char **argv){ if( zJMode ){ speedtest1_exec("PRAGMA journal_mode=%s", zJMode); } + if( nHardHeapLmt>0 ){ + speedtest1_exec("PRAGMA hard_heap_limit=%d", nHardHeapLmt); + } + if( nSoftHeapLmt>0 ){ + speedtest1_exec("PRAGMA soft_heap_limit=%d", nSoftHeapLmt); + } + if( zJMode ){ + speedtest1_exec("PRAGMA journal_mode=%s", zJMode); + } if( g.bExplain ) printf(".explain\n.echo on\n"); if( strcmp(zTSet,"mix1")==0 ) zTSet = zMix1Tests; |