From: Steinar H. Gunderson Date: Tue, 13 Nov 2018 23:45:32 +0000 (+0100) Subject: Speed up the database writes a bit, especially when I/O is busy. X-Git-Tag: 1.8.0~76^2~11 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=c786b9e247c7169e7a8097b37259dfa6ecd5a953 Speed up the database writes a bit, especially when I/O is busy. --- 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()