atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
19.25k stars 530 forks source link

Atuin Daemon improvements #2008

Open ellie opened 2 months ago

ellie commented 2 months ago

While the daemon has now been merged, as of #2006, there are a few things left to improve it

Nemo157 commented 2 months ago

Couple things I noticed trying it out:

Nemo157 commented 1 month ago

Are there any plans to integrate other functionality into the daemon? I've noticed rarely sometimes auto-completion is delayed, I presume it's something similar to #2042 where the sqlite database is locked by the daemon for a while because of #952, so the client trying to search the history for autocompletion gets blocked. If history queries were also proxied through to the daemon that would avoid this issue. I also assume setting up the daemon connection should be faster than opening the database so that might even reduce the latency slightly.

ellie commented 1 month ago

Potentially other functionality yes, but not that I'm afraid. The database is only locked for the duration of the write transaction, which generally should not be more than single digit ms.

That sort of functionality is only beneficial for users of ZFS (and maybe btrfs, though I don't know of many people using that), and there's only so much complexity I'm willing to add to workaround the poor interaction of ZFS/SQLite.

Realistically the serialization/"network call"/grpc server steps would lead to a slight decrease in performance for everybody else, vs making a sqlite query to an embedded database.