1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Improvements to the speedtest.tcl script. Add documentation on how to use the

script.

FossilOrigin-Name: eb3853d08141bf941193e8ecaf991191bb7fb46287818708a84018520eb1835e
This commit is contained in:
drh
2025-01-17 15:39:48 +00:00
parent e024421624
commit ada3470075
4 changed files with 75 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
C Add\sthe\stest/speedtest.tcl\sscript\sto\ssimplify\sperformance\sand\ssize\stesting. C Improvements\sto\sthe\sspeedtest.tcl\sscript.\s\sAdd\sdocumentation\son\show\sto\suse\sthe\nscript.
D 2025-01-17T12:32:01.367 D 2025-01-17T15:39:48.918
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
@@ -1677,7 +1677,8 @@ F test/speed3.test 694affeb9100526007436334cf7d08f3d74b85ef
F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715 F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c 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/speedtest1.c 323ce0956430a5aae56ea20f502da7bea3fb62b8ed02e9b0f12ab078b2b258f5
F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e
F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3 F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
@@ -2206,8 +2207,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 4d96759694c91301410f53a3f737a049c33e8b259b0954ff659714aff8b21ae8 P ad7b38672656d0336a73bb789ec83f6939fbdae81e21be68e0313006826dc294
R 7f163047a093ae4e315e910ea1611ab4 R f4c44da8ff797a58ac8642b4946994e1
U drh U drh
Z 4d5c65aabce50a5f7c599ac5c2690d5d Z f6ee9eb4c1425ae484e244ffbda51720
# Remove this line to create a well-formed Fossil manifest. # Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
ad7b38672656d0336a73bb789ec83f6939fbdae81e21be68e0313006826dc294 eb3853d08141bf941193e8ecaf991191bb7fb46287818708a84018520eb1835e

53
test/speedtest.md Normal file
View File

@@ -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.

View File

@@ -19,11 +19,16 @@ diff-file is specified then show a diff from the diff-file to the new
output. output.
Other options include: Other options include:
--dryrun Show what would happen but don't do anything CC=... Specify an alternative C compiler. Default is "gcc".
--help Show this help screen -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. --lean "Lean" mode.
--lookaside N SZ Lookahead uses N slots of SZ bytes each --lookaside N SZ Lookahead uses N slots of SZ bytes each.
--pagesize N Use N as the page size --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 srcfile {}
set outfile {} set outfile {}
@@ -66,6 +71,11 @@ for {set i 0} {$i<[llength $argv]} {incr i} {
-DSQLITE_OMIT_SHARED_CACHE \ -DSQLITE_OMIT_SHARED_CACHE \
-DSQLITE_USE_ALLOCA -DSQLITE_USE_ALLOCA
} }
-testset -
--testset {
incr i
set testset [lindex $argv $i]
}
-n - -n -
-dryrun - -dryrun -
--dryrun { --dryrun {