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.
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.