stig icon indicating copy to clipboard operation
stig copied to clipboard

File list very slow on large torrents

Open hypevhs opened this issue 5 years ago • 4 comments

Hi, I am running version 0.9.0a, the latest from PyPi. (If you would like me to retest using master, just ask)

I opened up a filelist of one torrent that had ~800 files in 20 directories. Just scrolling up and down takes 2.5s per each keypress. I typically expect this performance given that I'm running on a Chromebook, but I would imagine that it could have the same complexity as a terminal pager like less(1).

Is there any optimization that can be done to this view? Or any setting that would make scrolling and marking faster? Thanks.

hypevhs avatar Jul 28 '18 22:07 hypevhs

Yeah, that's expected. Sorry. stig isn't very snappy in general, but the file list is especially bad.

I tried to address any obvious bottlenecks, but the TUI file list code is quite complex, so I may have missed something.

It would likely be much more efficient if I removed the tree view and just displayed a flat list of file paths, but implementing that was quite hard and I really like it. There could be an option that enables/disables the tree view.

Filtering for specific files may help for now:

filelist 'the name of the torrent' 'files that contain this'

You can also filter files based on size or other criteria. See the "filter" help for a list.

rndusr avatar Jul 28 '18 22:07 rndusr

Would it be any faster if the filelist opened with all folders collapsed, so that the user only expands the folders they need to? It would also make it easier to scroll through torrents with many files in several subdirectories, as right now the user has to scroll through every file to reach the bottom.

fn-ix avatar Jan 26 '20 22:01 fn-ix

It might be faster, but I'm pretty sure the issue is connected to urwid's ListBox. Either it's implemented inefficiently or I'm not smart enough to use it correctly. Large torrent lists (also ListBoxes) are also slow, and collapsing isn't possible for them.

I've decided to try prompt-toolkit to fix this and other issues.

rndusr avatar Jan 27 '20 09:01 rndusr

Ok, good to hear some attention is being given to this! ;)

fn-ix avatar Jan 27 '20 10:01 fn-ix