Closed phiresky closed 4 years ago
Also, setting PRAGMA journal_mode = WAL
seems to improve insert performance a lot (50% maybe)
Here are some other settings that usually improve performance, but most of these do not persist:
pragma temp_store = memory;
pragma journal_mode = WAL;
pragma synchronous = normal;
pragma cache_size=-30000;
pragma optimize;
I like this, but I will have to meditate a little on the update outcome race.
I think this was fixed here: https://github.com/larkery/zsh-histdb/commit/873610f13d2f6568363cfa9767bc0d3e75dbe2db
(semi-relevant to #2)
I've just benchmarked a bit by adding
time
in front of the sqlite3 command in_histdb_query
, and with a ~15MB history file, it takes ~50-100ms before a command is executed, and ~30ms for the time update.Currently, these insert/updates are run synchronously, but it seems to me that (since the output of these commands is not used), it should work the same way to just run them in the background, which makes the shell noticeably more responsive:
The only problem I can see here is that it maybe could cause
histdb-update-outcome
to run before the insert in zshaddhistory?