Repository navigation
perf: run the SQLite engine in AUTOCOMMIT by default - #1852
Conversation
Standalone queries on SQLite switched each pooled connection into AUTOCOMMIT and back via an engine view, which costs two hops to the aiosqlite driver thread per query. The SQLite engine now runs in AUTOCOMMIT like MySQL, and standalone queries use the engine directly when it already is. SQLite transactions keep their explicit BEGIN, which opens a real transaction on an AUTOCOMMIT connection, so no isolation switch is needed there. Postgres is unchanged.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will improve performance by 26.25%
|
On SQLite every standalone query switched its pooled connection into AUTOCOMMIT and back through an engine view, costing two hops to the aiosqlite driver thread per query. The SQLite engine now runs in AUTOCOMMIT like MySQL (#1811), and standalone queries use the engine directly when it already is.
get/create/save/delete/countare 25–45% faster on SQLite; transactional paths are unchanged.BEGIN, which opens a real transaction on an AUTOCOMMIT connection, so savepoints and rollbacks work without an isolation switch. MySQL still switches to the server default isolation, so the Upgrade from 0.21 to 0.23 degraded our app performance significantly #1629 savepoint error can't come back.isolation_levelis respected.test_standalone_query_uses_autocommitnow checks autocommit via_is_autocommit_isolation()and that rows written in a transaction stay invisible to other connections until commit.