atuin icon indicating copy to clipboard operation
atuin copied to clipboard

slow output from history list or search

Open conradludgate opened this issue 3 years ago • 4 comments

When running atuin history list or atuin search with a large database, it takes a while for the output to trickle into the stdout (currently a few seconds in my case). It would be better to paginate/stream the output from sqlite to the terminal so you don't get that lag

conradludgate avatar Nov 21 '21 16:11 conradludgate

I'm very happy to find out that sqlx exposes a fetch method that returns a stream future :raised_hands:. It's gonna take a bit of refactoring to get it to work, but I'm committed :sunglasses:

conradludgate avatar Nov 21 '21 19:11 conradludgate

I just remembered that one of the reasons I was hesitant to do this was that I wouldn't be able to format the output into a table quite so nicely.

But tbh that's really not very important :woman_shrugging:

ellie avatar Dec 08 '21 23:12 ellie

@conradludgate is it still slow with https://github.com/ellie/atuin/pull/181 applied?

mwotton avatar Dec 09 '21 05:12 mwotton

Most likely. The throughput wasn't super greatly improved, but the time for first byte to the terminal is instant compared to a few seconds.

I'll test it though

conradludgate avatar Dec 09 '21 06:12 conradludgate