Tribler / tribler

Privacy enhanced BitTorrent client with P2P content discovery
https://www.tribler.org
GNU General Public License v3.0
4.73k stars 445 forks source link

Performance improvements for getting/selecting files using the web API #8043

Closed egbertbouman closed 1 week ago

egbertbouman commented 1 month ago

While working on the webui (https://github.com/Tribler/tribler/issues/7736), I noticed that getting and selecting files was very slow, to the point that the core was locking up. This PR fixes this problem.

I tested this PR using a torrent with 28700 files in it, and got a 11x speedup for getting files and a 50x speedup for selecting files. (on my machine it now takes 0.4s to get 28.7K files and 0.13s to change the selected files).

With these speedups, I don't have to use to the tree logic when building the webui, and I can just use standard client-side pagination. This makes things much simpler.

egbertbouman commented 1 week ago

The web UI is now part of Tribler Experimental, and I'll focus on working the web UI from there.

Given that these changes are mostly useful for the web UI anyway, I'm closing this PR.