Skip to content

Instantly share code, notes, and snippets.

@zamazan4ik
Created October 12, 2024 14:31
Show Gist options
  • Save zamazan4ik/c62736b4a8ba6e59f22b0f949206faed to your computer and use it in GitHub Desktop.
Save zamazan4ik/c62736b4a8ba6e59f22b0f949206faed to your computer and use it in GitHub Desktop.
sqlite speedtest: Clang PGO optimized
taskset -c 0 ./speedtest_clang_pgo_optimized --shrink-memory --reprepare --stats --heap 10000000 64 --size 200
100 - 100000 INSERTs into table with no index..................... 0.095s
110 - 100000 ordered INSERTS with one index/PK.................... 0.130s
120 - 100000 unordered INSERTS with one index/PK.................. 0.158s
130 - 25 SELECTS, numeric BETWEEN, unindexed...................... 0.124s
140 - 10 SELECTS, LIKE, unindexed................................. 0.142s
142 - 10 SELECTS w/ORDER BY, unindexed............................ 0.227s
145 - 10 SELECTS w/ORDER BY and LIMIT, unindexed.................. 0.117s
150 - CREATE INDEX five times..................................... 0.173s
160 - 20000 SELECTS, numeric BETWEEN, indexed..................... 0.202s
161 - 20000 SELECTS, numeric BETWEEN, PK.......................... 0.203s
170 - 20000 SELECTS, text BETWEEN, indexed........................ 0.689s
180 - 100000 INSERTS with three indexes........................... 0.685s
190 - DELETE and REFILL one table................................. 0.711s
200 - VACUUM...................................................... 0.463s
210 - ALTER TABLE ADD COLUMN, and query........................... 0.006s
230 - 20000 UPDATES, numeric BETWEEN, indexed..................... 0.231s
240 - 100000 UPDATES of individual rows........................... 0.817s
250 - One big UPDATE of the whole 100000-row table................ 0.049s
260 - Query added column after filling............................ 0.006s
270 - 20000 DELETEs, numeric BETWEEN, indexed..................... 1.140s
280 - 100000 DELETEs of individual rows........................... 1.072s
290 - Refill two 100000-row tables using REPLACE.................. 1.208s
300 - Refill a 100000-row table using (b&1)==(a&1)................ 0.413s
310 - 20000 four-ways joins....................................... 1.409s
320 - subquery in result set...................................... 0.987s
400 - 140000 REPLACE ops on an IPK................................ 0.727s
410 - 140000 SELECTS on an IPK.................................... 0.544s
500 - 140000 REPLACE on TEXT PK................................... 0.649s
510 - 140000 SELECTS on a TEXT PK................................. 0.604s
520 - 140000 SELECT DISTINCT...................................... 0.183s
980 - PRAGMA integrity_check...................................... 0.974s
990 - ANALYZE..................................................... 0.057s
TOTAL....................................................... 15.195s
-- Compile option: ATOMIC_INTRINSICS=1
-- Compile option: COMPILER=clang-18.1.8
-- Compile option: DEFAULT_AUTOVACUUM
-- Compile option: DEFAULT_CACHE_SIZE=-2000
-- Compile option: DEFAULT_FILE_FORMAT=4
-- Compile option: DEFAULT_JOURNAL_SIZE_LIMIT=-1
-- Compile option: DEFAULT_MMAP_SIZE=0
-- Compile option: DEFAULT_PAGE_SIZE=4096
-- Compile option: DEFAULT_PCACHE_INITSZ=20
-- Compile option: DEFAULT_RECURSIVE_TRIGGERS
-- Compile option: DEFAULT_SECTOR_SIZE=4096
-- Compile option: DEFAULT_SYNCHRONOUS=2
-- Compile option: DEFAULT_WAL_AUTOCHECKPOINT=1000
-- Compile option: DEFAULT_WAL_SYNCHRONOUS=2
-- Compile option: DEFAULT_WORKER_THREADS=0
-- Compile option: DIRECT_OVERFLOW_READ
-- Compile option: ENABLE_MEMSYS5
-- Compile option: MALLOC_SOFT_LIMIT=1024
-- Compile option: MAX_ATTACHED=10
-- Compile option: MAX_COLUMN=2000
-- Compile option: MAX_COMPOUND_SELECT=500
-- Compile option: MAX_DEFAULT_PAGE_SIZE=8192
-- Compile option: MAX_EXPR_DEPTH=1000
-- Compile option: MAX_FUNCTION_ARG=127
-- Compile option: MAX_LENGTH=1000000000
-- Compile option: MAX_LIKE_PATTERN_LENGTH=50000
-- Compile option: MAX_MMAP_SIZE=0x7fff0000
-- Compile option: MAX_PAGE_COUNT=0xfffffffe
-- Compile option: MAX_PAGE_SIZE=65536
-- Compile option: MAX_SQL_LENGTH=1000000000
-- Compile option: MAX_TRIGGER_DEPTH=1000
-- Compile option: MAX_VARIABLE_NUMBER=32766
-- Compile option: MAX_VDBE_OP=250000000
-- Compile option: MAX_WORKER_THREADS=8
-- Compile option: MUTEX_PTHREADS
-- Compile option: SYSTEM_MALLOC
-- Compile option: TEMP_STORE=1
-- Compile option: THREADSAFE=1
-- Lookaside Slots Used: 1 (max 132)
-- Successful lookasides: 29023971
-- Lookaside size faults: 40170
-- Lookaside OOM faults: 0
-- Pager Heap Usage: 18944 bytes
-- Page cache hits: 7714583
-- Page cache misses: 5053535
-- Page cache writes: 875633
-- Schema Heap Usage: 9920 bytes
-- Statement Heap Usage: 0 bytes
-- Memory Used (bytes): 0 (max 8118144)
-- Outstanding Allocations: 0 (max 1142)
-- Pcache Overflow Bytes: 0 (max 7454720)
-- Largest Allocation: 2097130 bytes
-- Largest Pcache Allocation: 4368 bytes
-- Bytes received by read(): 20852512706
-- Bytes sent to write(): 3858800690
-- Read() system calls: 5090985
-- Write() system calls: 998135
-- Bytes rcvd from storage: 0
-- Bytes sent to storage: 320876544
-- Cancelled write bytes: 241770496
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment