This bucket runs the request-shaped SQLite benchmark through several Rust paths:
rust_rusqlite/*: directrusqlitecalls.rust_rusqlite_query_only/*: directrusqlitereads through a connection withPRAGMA query_only = ON.rust_marmot/*: generatedrusqlitecalls from colocated.sqlfiles.rust_sqlx/*:sqlxwith aSqlitePoolandmax_connections(5).rust_sqlx_pool1/*: same SQLx pool path withmax_connections(1).rust_sqlx_conn/*: SQLx using one acquired pooled connection for the request loop.rust_sqlx_direct/*: SQLx using a directSqliteConnection.rust_sqlx_direct_tuned/*: direct SQLx connection with worker/cache knobs adjusted.rust_sqlx_manual_tx/*: direct SQLx connection with manualBEGIN/COMMITfor the update request.
Run it in release mode:
cargo run --release --quiet -- 5000The runner creates rust_benchmark.sqlite3 in this directory and prints:
case,items,micros,us_per_item,check
Cases:
rust_rusqlite/app_request/seed_dummy_datarust_rusqlite/app_request/admin_item_editrust_rusqlite_query_only/app_request/admin_item_editrust_rusqlite/app_request/admin_item_updaterust_marmot/app_request/seed_dummy_datarust_marmot/app_request/admin_item_editrust_marmot/app_request/admin_item_updaterust_sqlx/app_request/seed_dummy_datarust_sqlx/app_request/admin_item_editrust_sqlx/app_request/admin_item_updaterust_sqlx_pool1/app_request/*rust_sqlx_conn/app_request/*rust_sqlx_direct/app_request/*rust_sqlx_direct_tuned/app_request/*rust_sqlx_manual_tx/app_request/admin_item_update
SQLite is configured with WAL, busy_timeout=5000, and foreign keys enabled.
The query-only rusqlite case uses the same read-heavy request shape after
enabling PRAGMA query_only = ON, and asserts that a write through that
connection is rejected.
The baseline SQLx pool uses max_connections(5). The rusqlite path uses the
same request-shaped sequence with normal driver calls, not a hot
prepared-statement loop.
The Marmot path uses SQL files in src/app_request/sql/ and generated code in
src/generated/sql/. Regenerate it from the sibling Marmot checkout with:
cd /Users/daverapin/projects/rust/marmot
cargo run -- generate \
--database /Users/daverapin/projects/gleam/sqlite_tests/rust/rust_benchmark.sqlite3 \
--source-root /Users/daverapin/projects/gleam/sqlite_tests/rust/src \
--output /Users/daverapin/projects/gleam/sqlite_tests/rust/src/generated/sqlThe SQLx variants are included to isolate overhead. The current fastest SQLx
shape for the read-heavy request is rust_sqlx_conn/*, which avoids checking a
connection out of the pool for every query. The direct and tuned direct
connections were not meaningfully faster in the M4 MacBook Air run.