Debian Codegraph @

test/speedtest.md

raw
1 # Performance And Size Measurements
2
3 This document shows a procedure for making performance and size
4 comparisons between two versions of the SQLite Amalgamation "sqlite3.c".
5 You will need:
6
7 * fossil
8 * valgrind
9 * tclsh
10 * A script or program named "open" that brings up *.txt files in an
11 editor for viewing. (Macs provide this by default. On Linux it's
12 called xdg-open and some distributions symlink it to "open". You'll
13 need to come up with your own on Windows.)
14 * An SQLite source tree
15
16 The procedure described in this document is not the only way to make
17 performance and size measurements. Use this as a guide and make
18 adjustments as needed.
19
20 ## Establish the baseline measurement
21
22 * Begin at the root the SQLite source tree
23 * <b>mkdir -p ../speed</b> <br>
24 &uarr; Speed measurement output files will go into this directory.
25 You can actually put those files wherever you want. This is just a
26 suggestion. It might be good to keep these files outside of the
27 source tree so that "fossil clean" does not delete them.
28 * Obtain the baseline SQLite amalgamation. For the purpose of this
29 technical note, assume the baseline SQLite sources are in files
30 "../baseline/sqlite3.c" and "../baseline/sqlite3.h".
31 * <b>test/speedtest.tcl ../baseline/sqlite3.c ../speed/baseline.txt</b> <br>
32 &uarr; The performance measure will be written into ../speed/baseline.txt
33 and that file will be brought up in an editor for easy viewing. <br>
34 &uarr; The "sqlite3.h" will be taken from the directory that contains
35 the "sqlite3.c" amalgamation file.
36
37 ## Comparing the current checkout against the baseline
38
39 * <b>make sqlite3.c</b>
40 * <b>test/speedtest.tcl sqlite3.c ../speed/test.txt ../speed/baseline.txt</b> <br>
41 &uarr; Test results written into ../speed/test.txt and then
42 "fossil xdiff" is run to compare ../speed/baseline.txt against
43 the new test results.
44
45 ## When to do this
46
47 Performance and size checks should be done prior to trunk check-ins.
48 Sometimes a seemingly innocuous change can have large performance
49 impacts. A large impact does not mean that the change cannot continue,
50 but it is important to be aware of the impact.
51
52 ## Additional hints
53
54 Use the --help option to test/speedtest.tcl to see other available options.