mirror of
https://github.com/safing/portmaster.git
synced 2026-12-04 09:38:21 +00:00
b56aba0c89
modernc.org/sqlite re-parses the SQL text on every statement execution, so the prepared statement in PutMany gave no benefit and parsing accounted for about half of the time spent per record. Writing 50 records per INSERT ... ON CONFLICT DO UPDATE statement amortizes that cost: the per-record time in BenchmarkPutManyPreparedStmt dropped from roughly 100 µs to 50 µs on the same machine. PutMany is used for the intel filter list import and for the resolver's delayed cache flushes. Importing a filter list base update is now roughly twice as fast on the database side. Stored data is unchanged, including NULL format and value for records without data. Duplicate keys within one statement resolve to the last write, as before. A failed prepare now rolls the transaction back instead of leaving it open. The new test covers full and partial statements and re-writing existing keys, for both the batched and the single-row PutMany path.