]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Improvements to the speedtest.tcl script. Add documentation on how to use the
authordrh <>
Fri, 17 Jan 2025 15:39:48 +0000 (15:39 +0000)
committerdrh <>
Fri, 17 Jan 2025 15:39:48 +0000 (15:39 +0000)
script.

FossilOrigin-Name: eb3853d08141bf941193e8ecaf991191bb7fb46287818708a84018520eb1835e

manifest
manifest.uuid
test/speedtest.md [new file with mode: 0644]
test/speedtest.tcl

index 33319f9174fe28a1c42ac3439896e2262ac96427..c97b983558ab0c5e2997b4db97a27bdf55139879 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sthe\stest/speedtest.tcl\sscript\sto\ssimplify\sperformance\sand\ssize\stesting.
-D 2025-01-17T12:32:01.367
+C Improvements\sto\sthe\sspeedtest.tcl\sscript.\s\sAdd\sdocumentation\son\show\sto\suse\sthe\nscript.
+D 2025-01-17T15:39:48.918
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
@@ -1677,7 +1677,8 @@ F test/speed3.test 694affeb9100526007436334cf7d08f3d74b85ef
 F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
 F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
 F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c
-F test/speedtest.tcl 76a0959d7d16cbebae49756bbb858a3d2f1d9081e757c87cb7fea7c816d1c575 x
+F test/speedtest.md 3ce32f2d60cf701381f95e1d8c916b6c57c31ae015f096224e83823f9b3a3d87
+F test/speedtest.tcl 96052cb8c5d44f69e0600e690794557f176ef99bd87cb4360080982d1f479a70 x
 F test/speedtest1.c 323ce0956430a5aae56ea20f502da7bea3fb62b8ed02e9b0f12ab078b2b258f5
 F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e
 F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
@@ -2206,8 +2207,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 4d96759694c91301410f53a3f737a049c33e8b259b0954ff659714aff8b21ae8
-R 7f163047a093ae4e315e910ea1611ab4
+P ad7b38672656d0336a73bb789ec83f6939fbdae81e21be68e0313006826dc294
+R f4c44da8ff797a58ac8642b4946994e1
 U drh
-Z 4d5c65aabce50a5f7c599ac5c2690d5d
+Z f6ee9eb4c1425ae484e244ffbda51720
 # Remove this line to create a well-formed Fossil manifest.
index 36403859dc57c060a2f69a1b6060504a0b8d8df6..d830cfeb9206a7cc3f0b3dba3c3b51e2e1e000d3 100644 (file)
@@ -1 +1 @@
-ad7b38672656d0336a73bb789ec83f6939fbdae81e21be68e0313006826dc294
+eb3853d08141bf941193e8ecaf991191bb7fb46287818708a84018520eb1835e
diff --git a/test/speedtest.md b/test/speedtest.md
new file mode 100644 (file)
index 0000000..0a575b6
--- /dev/null
@@ -0,0 +1,53 @@
+# Performance And Size Measurements
+
+This document shows a procedure for making performance and size
+comparisons between two versions of the SQLite Amalgamation "sqlite3.c".
+You will need:
+
+  *  fossil
+  *  valgrind
+  *  tclsh
+  *  A script or program named "open" that brings up *.txt files in an
+     editor for viewing.  (Macs provide this by default.  You'll need to
+     come up with your own on Linxu and Windows.)
+  *  An SQLite source tree
+
+The procedure described in this document is not the only way to make
+performance and size measurements.  Use this as a guide and make
+adjustments as needed.
+
+## Establish the baseline measurement
+
+  *  Begin at the root the SQLite source tree
+  *  <b>mkdir -p ../speed</b> <br>
+      &uarr;  Speed measurement output files will go into this directory.
+     You can actually put those files wherever you want.  This is just a
+     suggestion.  It might be good to keep these files outside of the
+     source tree so that "fossil clean" does not delete them.
+  *  Obtain the baseline SQLite amalgamation.  For the purpose of this
+     technical not, assume the baseline SQLite sources are in files
+     "../baseline/sqlite3.c" and "../baseline/sqlite3.h".
+  *  <b>test/speedtest.tcl ../baseline/sqlite3.c ../speed/baseline.txt</b> <br>
+     &uarr; The performance measure will be written into ../speed/baseline.txt
+     and that file will be brought up in an editor for easy viewing. <br>
+     &uarr; The "sqlite3.h" will be taken from the directory that contains
+     the "sqlite3.c" amalgamation file.
+
+## Comparing the current checkout against the baseline
+
+  *  <b>make sqlite3.c</b>
+  *  <b>test/speedtest.tcl sqlite3.c ../speed/test.txt ../speed/baseline.txt</b> <br>
+     &uarr; Test results written into ../speed/test.txt and then
+     "fossil xdiff" is run to compare ../speed/baseline.txt against
+     the new test results.
+
+## When to do this
+
+Performance and size checks should be done prior to trunk check-ins.
+Sometimes a seemingly innocuous change can have large performance
+impacts.  A large impact does not mean that the change cannot continue,
+but it is important to be aware of the impact.
+
+## Additional hints
+
+Use the --help option to test/speedtest.tcl to see other available options.
index 1d6cf4e9d80a9651fb79e0f92e78fad3687bd5dc..b353077e7c0469f0987afc8993984f7b6f62f16b 100755 (executable)
@@ -19,11 +19,16 @@ diff-file is specified then show a diff from the diff-file to the new
 output.
 
 Other options include:
-   --dryrun              Show what would happen but don't do anything
-   --help                Show this help screen
+   CC=...                Specify an alternative C compiler.  Default is "gcc".
+   -D...                 -D and -O options are passed through to the C compiler.
+   --dryrun              Show what would happen but don't do anything.
+   --help                Show this help screen.
    --lean                "Lean" mode.
-   --lookaside N SZ      Lookahead uses N slots of SZ bytes each
-   --pagesize N          Use N as the page size
+   --lookaside N SZ      Lookahead uses N slots of SZ bytes each.
+   --pagesize N          Use N as the page size.
+   --testset TEST        Specify the specific testset to use.  The default
+                         is "mix1".  Other options include: "main", "json",
+                         "cte", "orm", "fp", "rtree".
 }
 set srcfile {}
 set outfile {}
@@ -66,6 +71,11 @@ for {set i 0} {$i<[llength $argv]} {incr i} {
            -DSQLITE_OMIT_SHARED_CACHE \
            -DSQLITE_USE_ALLOCA
       }
+      -testset -
+      --testset {
+        incr i
+        set testset [lindex $argv $i]
+      }
       -n -
       -dryrun -
       --dryrun {