Enabling SQLite WAL mode for improved performance on slow SSD

Hi
In my Linux machine sending a requests that responds in ≈50ms would take yaak about ≈5 seconds to respond.
After investigating, I found that it was coming from SQLite, my machine has a slow SSD and everytime a write is done, it’s slowing down the whole app. In my other machine that has yaak installed on a fast nvme ssd, the app was always pretty fast.
The SQLite app database is running in default journal_mode = DELETE with synchronous = FULL, meaning every commit does a full fsync if I understand well. When a request produces many rapid writes (e.g. the response timeline rows), each row has to wait for its own fsync, so the timeline appears row-by-row instead of all at once and everything slows down.
Enabling SQLite WAL mode makes the app about 10 times faster in my machine. I guess the benefit would be even bigger on machines that still use hdd.
I have a working demo that I did with the help of AI (I haven’t done a pull request because this seems out of scope according to CONTRIBUTING.md and I don’t know Rust), but you can have a look if you want to see how the potential fix was done → https://github.com/Arkounay/yaak/tree/feat/sqlite-wal-mode-setting
Here’s an example of the times with the current yaak version:
(1.7s)

and same request with WAL mode on my machine
(22ms)

the longer the timeline is, the bigger is the benefit