qbittorrent/qBittorrent — pull request #295 by sledgehammer999 (2012-12-26 18:21:01+00:00)
Title: Optimize torrent addittion of huge torrents

See also issue #288

The provided torrent in the forum post has 18000 files. The user tried to add the torrent and it took him "95 minutes of CPU time ".

For the first commit:
I removed the code that tries to remove old dirs. To tell you the truth I cannot understand why the code is there. I cannot think of a potential use case. This function is called only for newly added items so it doesn't make sense try to remove "old directories". On my machine is added in 5-6secs after I close the "add new torrent dialog." Although there is a 1-2secs lag for the dialog to appear or when selecting the torrent in the transfer list.

For the second commit:
This is from experience from the first commit. Not "h.absolute_files_path()" 18000 times saves a lot of time. On the first commit I could add the torrent in ~11secs, so here is should improve the speed accordingly. I didn't actually benchmark it though.