SQLite Forum

WAL journal and threading mode
Login
Journal mode and threading mode are orthogonal concepts. You still need exactly the same thread protection as before.

WAL journal mode is about multiple READERS and a SINGLE writer; multiple writers still have to take turns.

The performance gain is mostly from changing the synch mode to normal, which is not recommended for journal mode DELETE/TRUNCATE/PERSIST, but consistent with changing to WAL mode.

Did you profile your application to see where the CPU is spending so much time? My guess is that most of your threads are busy-wating in a tight loop for the write lock on the WAL journal most of the time. Maybe you would like to consider synchronizing your writer threads with a semaphore that blocks threads that want to write before harassing SQLite.