From c786b9e247c7169e7a8097b37259dfa6ecd5a953 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 14 Nov 2018 00:45:32 +0100 Subject: [PATCH] Speed up the database writes a bit, especially when I/O is busy. --- db.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db.cpp b/db.cpp index 9b0de35..c3e647c 100644 --- a/db.cpp +++ b/db.cpp @@ -15,6 +15,9 @@ DB::DB(const std::string &filename) sqlite3_exec(db, R"( CREATE TABLE IF NOT EXISTS state (state BLOB); )", nullptr, nullptr, nullptr); // Ignore errors. + + sqlite3_exec(db, "PRAGMA journal_mode=WAL", nullptr, nullptr, nullptr); // Ignore errors. + sqlite3_exec(db, "PRAGMA synchronous=NORMAL", nullptr, nullptr, nullptr); // Ignore errors. } StateProto DB::get_state() -- 2.39.2