]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Provide new command-line options --hard-heap-limit and --soft-heap-limit
authordrh <>
Thu, 10 Apr 2025 19:39:34 +0000 (19:39 +0000)
committerdrh <>
Thu, 10 Apr 2025 19:39:34 +0000 (19:39 +0000)
for speedtest1.

FossilOrigin-Name: 578e9fedeaaacd152ae1988920e6c9a0c43f664e2f9461c0994ba427ae1688e7

manifest
manifest.uuid
test/speedtest1.c

index 201e1985498ce6034ff2916af562adbf84583583..a0ef6256a8cfbf09b7bfb54823e070ebb36af570 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Be\ssure\sthat\sspeedtest1\sreports\sany\serrors\sthat\sit\sencounters\swhile\nrunning\sthe\sspeed\stests.
-D 2025-04-10T19:03:42.977
+C Provide\snew\scommand-line\soptions\s--hard-heap-limit\sand\s--soft-heap-limit\nfor\sspeedtest1.
+D 2025-04-10T19:39:34.328
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -1687,7 +1687,7 @@ F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
 F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c
 F test/speedtest.md ee958457ae1b729d9715ae33c0320600000bf1d9ddea1a88dcf79f56729d6fad
 F test/speedtest.tcl 926d1e168f4a14e6fb68c5dc174de743536b547f365264bd5bac533b3621a4a0 x
-F test/speedtest1.c 3064b76adc1b0f3715ce3d898e3e4a8f484c19c2b53115c46a50293bb04f4439
+F test/speedtest1.c b6823a37a46d742a087f68495d63fc28d3b1a4fc6416a3366e0c67d01f19d105
 F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e
 F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
 F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 3516354ee57b683c134de206f5321f064f9cb627aa12ba6fde98e59a9093c50c
-R c138a52241458c8ca08673d2b100d73f
+P 8c8b1a99bc888a5db637900aa3c8ef1b8c748c527580c825a25df1008afcf9e0
+R 6387413ea82c4eeeabb5cf2294064ac0
 U drh
-Z 070311e397246e4eea2ac545196ad07f
+Z b94f061884cf2cdb326ad331d6bc2c81
 # Remove this line to create a well-formed Fossil manifest.
index f4cf356b68415c8e8fe3587fa81ee2ae3f700374..9f0a2c48af31eaa27343d9eff258ec55943a7f9e 100644 (file)
@@ -1 +1 @@
-8c8b1a99bc888a5db637900aa3c8ef1b8c748c527580c825a25df1008afcf9e0
+578e9fedeaaacd152ae1988920e6c9a0c43f664e2f9461c0994ba427ae1688e7
index 3dce5942b83d0491aef71be3faf0ac2e9bf57ef7..4a383e2e6ab47f2a77bfdb4ccf1ea57f15e1617b 100644 (file)
@@ -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;