Commit Graph

7 Commits

Author SHA1 Message Date
Alexandr Stelnykovych b56aba0c89 sqlite: write PutMany batches as multi-row upserts
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.
2026-10-19 16:46:04 +03:00
Alexandr Stelnykovych f9105fc738 (core) Update golang dependencies
``
go get -u ./...
go mod tidy
```
Fixed SQLite related code to fit latest changes in  SQLite driver
2025-11-12 12:37:33 +02:00
Alexandr Stelnykovych 015cb5a969 Reorder import statements for better organization and linter compliance 2025-09-03 13:16:32 +03:00
Alexandr Stelnykovych b41cded4cc Reorder import statements for better organization and linter compliance 2025-09-03 13:07:12 +03:00
Alexandr Stelnykovych c14eb43605 fix: Improve error handling for malformed records in SQLite storage 2025-09-03 12:44:43 +03:00
Alexandr Stelnykovych ce52869945 fix: Some configuration data is not stored in the core database when using SQLite.
https://github.com/safing/portmaster/issues/1989
2025-08-28 17:25:16 +03:00
Daniel 9b12dfffc2 Add option to use prepared statements for SQLite PutMany 2025-03-17 14:13:53 +01:00