Closed unixzii closed 9 months ago
I have tested this change and indeed it is now super smooth 🎉 Thanks!
Thanks a million, it works just as advertised!
It's so good to have this issue finally fixed!
And because we had to wait so long for this to be improved, I didn't want anybody to wait even longer: here is the new release
The UI is very laggy while the scanning is in progress, and it makes the program almost unusable during the first few seconds of startup. The bottleneck is
jwalk
iterator, it may block the UI thread sometimes. In this PR, I alleviated the situation by some optimizations, and the UI is now super responsive at startup.Here is what it looks like:
https://github.com/Byron/dua-cli/assets/3109144/3b06b888-c4ec-4c45-9468-36b0059cbe6c
Some implementation notes:
crossbeam::channel
to receive UI events andjwalk
entries. In contract tostd::sync::mpsc
, we can select from a set of channels without busy polling usingtry_recv
.input_channel
. The function provided bycrosstermion
returns astd::sync::mpsc::Receiver
value, which is not compatible withcrossbeam::select!
.