sqlite/test/json
drh 78f7d2f4c1 Clean up the JSONB performance test script.
FossilOrigin-Name: 905301075a7fc1010ee7e754867b1b698c9b8576d50e98125def32a5dfb7ee9d
2023-12-05 12:20:58 +00:00
..
json-generator.tcl Fix indentation and omit trailing whitespace in the random JSON generator 2023-04-28 13:25:35 +00:00
json-q1-b.txt Clean up the JSONB performance test script. 2023-12-05 12:20:58 +00:00
json-q1.txt Enhancements to the JSON performance testing scripts and instructions to 2023-07-28 14:20:31 +00:00
json-speed-check.sh Performance tests for JSONB added. 2023-09-27 16:55:13 +00:00
README.md Minor tweaks to the JSON performance measurement documentation. 2023-07-28 16:12:39 +00:00

The files in this subdirectory are used to help measure the performance of the SQLite JSON functions, especially in relation to handling large JSON inputs.

1.0 Prerequisites

  1. Valgrind

  2. Fossil

  3. tclsh

2.0 Setup

  1. Run: "tclsh json-generator.tcl | sqlite3 json100mb.db" to create the 100 megabyte test database. Do this so that the "json100mb.db" file lands in the directory from which you will run tests, not in the test/json subdirectory of the source tree.

  2. Build the baseline sqlite3.c file with sqlite3.h and shell.c. ("CFLAGS='-Os -g' make -e clean sqlite3.c")

  3. Run "sh json-speed-check.sh trunk". This creates the baseline profile in "jout-trunk.txt".

3.0 Testing

  1. Build the sqlite3.c (with sqlite3.h and shell.c) to be tested.

  2. Run "sh json-speed-check.sh x1". The profile output will appear in jout-x1.txt. Substitute any label you want in place of "x1".

  3. Run the script shown below in the CLI. Divide 2500 by the real elapse time from this test to get an estimate for number of MB/s that the JSON parser is able to process.

.open json100mb.db .timer on WITH RECURSIVE c(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM c WHERE n<25) SELECT sum(json_valid(x)) FROM c, data1;