From 21ea71e2575d76258bd81d89ab8ac883aa3bed36 Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Sat, 14 Mar 2026 11:33:03 -0400 Subject: [PATCH] perf(12-02): increase scan batch size from 50 to 300 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amortizes SQLite fsync cost over 6x fewer transactions. Cuts ~80 fsyncs for a 25K-track library — significant on HDD. --- backend/library/library.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/library/library.go b/backend/library/library.go index 445c84b..c31a7fb 100644 --- a/backend/library/library.go +++ b/backend/library/library.go @@ -29,7 +29,7 @@ import ( // scanBatchSize controls how many files are committed in a single // database transaction during a scan. Larger batches amortize // SQLite's fsync cost but increase the blast radius of a failed commit. -const scanBatchSize = 50 +const scanBatchSize = 300 // entityCache holds recently resolved database entities so that // repeated upserts for the same artist/album/cover art within a scan