broot
broot copied to clipboard
Feature Request: Async for previews
From https://github.com/Canop/broot/pull/1034#issuecomment-3282024441, displaying large images can be slow.
I identified these as being slow:
- Creating
ImageView:broot/src/preview/preview_state.rsPreviewState::new()broot/src/preview/preview.rsPreview::new()broot/src/image/image_view.rsImageView::new()
- Displaying
ImageView:broot/src/preview/preview_state.rspreview.display(w, disc, &self.preview_area)broot/src/preview/preview.rsSelf::Image(iv) => iv.display(w, disc, area)broot/src/image/image_view.rsImageView::display()
Could Broot switch to using async? Then the entire preview function could be async. Key presses can then cancel it at any point.
Could Broot switch to using async?
Broot contains a framework for executing tasks in background and for cancelling them. That's how search works, how long texts are read in background for preview, how sizes are computed, etc.
I'll see if I can improve reactivity by deferring some parts of the computation.