From 34cf3ad6b623e32b012e3c9afd32c065ba76fb73 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 8 May 2026 15:26:33 +0000 Subject: [PATCH 1/3] Turso: wrap CSV import in a single transaction Loading hits.csv via `.import` was fsync-bound: each 1000-row batch committed separately, so on EBS gp2 the per-batch fsync dominated. Wrapping the import in BEGIN/COMMIT collapses it to one fsync, and PRAGMA synchronous = OFF disables fsyncs within the transaction. A trailing wal_checkpoint(TRUNCATE) keeps `wc -c mydb` consistent. Measured on a 200K-row hits.csv slice (local SSD): 12.0s -> 9.1s. On EBS gp2 the speedup will be substantially larger. Co-Authored-By: Claude Opus 4.7 (1M context) --- turso/benchmark.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/turso/benchmark.sh b/turso/benchmark.sh index 47a96005ae..9540f3309d 100755 --- a/turso/benchmark.sh +++ b/turso/benchmark.sh @@ -13,7 +13,13 @@ tursodb mydb < create.sql ../download-hits-csv echo -n "Load time: " -command time -f '%e' tursodb mydb '.import --csv hits.csv hits' +command time -f '%e' tursodb mydb <<'EOF' +PRAGMA synchronous = OFF; +BEGIN; +.import --csv hits.csv hits +COMMIT; +EOF +tursodb mydb 'PRAGMA wal_checkpoint(TRUNCATE);' > /dev/null echo -n "Data size: " wc -c mydb From 3667498b0eb317c035713038200bea74c9d6fd75 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 8 May 2026 15:28:32 +0000 Subject: [PATCH 2/3] Turso: bump to v0.6.0-pre.27 Pinned version was v0.1.2-pre.4 from July 2025. v0.6.0-pre.27 is the latest release and adds an aarch64-unknown-linux-gnu artifact, so the benchmark runs on both x86_64 and arm64 hosts. Co-Authored-By: Claude Opus 4.7 (1M context) --- turso/benchmark.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turso/benchmark.sh b/turso/benchmark.sh index 9540f3309d..ec7d5e849d 100755 --- a/turso/benchmark.sh +++ b/turso/benchmark.sh @@ -4,7 +4,7 @@ sudo apt-get update -y sudo apt-get install -y curl # Download and install Turso -curl --proto '=https' --tlsv1.2 -LsSf https://github.com/tursodatabase/turso/releases/download/v0.1.2-pre.4/turso_cli-installer.sh | sh +curl --proto '=https' --tlsv1.2 -LsSf https://github.com/tursodatabase/turso/releases/download/v0.6.0-pre.27/turso_cli-installer.sh | sh export HOME=${HOME:=~} source $HOME/.turso/env From bb5a2e89ba94e1cbae375411330576b7ca4175b2 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 8 May 2026 15:46:27 +0000 Subject: [PATCH 3/3] Turso: silence per-batch import progress lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `.import` prints "Inserting batch of 1000 rows" once per batch — that's ~100k lines on the full hits.csv, which bloats log.txt. Filter the progress lines out; errors still pass through grep -v. Co-Authored-By: Claude Opus 4.7 (1M context) --- turso/benchmark.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turso/benchmark.sh b/turso/benchmark.sh index ec7d5e849d..253d3c5060 100755 --- a/turso/benchmark.sh +++ b/turso/benchmark.sh @@ -13,7 +13,7 @@ tursodb mydb < create.sql ../download-hits-csv echo -n "Load time: " -command time -f '%e' tursodb mydb <<'EOF' +command time -f '%e' tursodb mydb <<'EOF' 2>&1 | grep -v '^Inserting batch of' PRAGMA synchronous = OFF; BEGIN; .import --csv hits.csv hits