Skip to content

Conversation

@glassez
Copy link
Member

@glassez glassez commented Dec 6, 2025

Unfortunately, the filtering algorithm used since #23452 has a noticeable performance degradation with an increase in the number of trackers per torrent. This is noticeable when switching the tracker filter if you have many torrents (several thousand), each of which has many trackers (several dozen).
This PR is designed to partially improve filtering performance by caching tracker hostnames to avoid re-parsing tracker URLs.

P.S. It's still not as productive as it used to be, so in the future I'll try to add some kind of data indexing to fix this (if it really bothers users).

@glassez glassez added this to the 5.2 milestone Dec 6, 2025
@glassez glassez added the Hotfix Fix some bug(s) introduced by recently merged commit(s) label Dec 6, 2025
@glassez glassez requested a review from a team December 6, 2025 08:27
@sledgehammer999
Copy link
Member

Is it intended that the cache entries will never be invalidated during runtime?

@glassez
Copy link
Member Author

glassez commented Dec 6, 2025

Is it intended that the cache entries will never be invalidated during runtime?

It's hardly really necessary to care about invalidating them. I can't imagine suitable conditions for deleting an item from the cache:

  1. The point is to have all the current trackers there, so the cache size limitation strategy doesn't make sense in this case.
  2. If you want deleting a tracker that has been deleted from all torrents, then implementation of such a strategy would be a couple of orders of magnitude more complex than this, but in this case I would think of some other solution that, with a similar complexity of implementation, would bring greater performance optimization.

@Chocobo1
Copy link
Member

What about let the cache become TorrentFilter class member? So it can be 'unloaded' when the filter is not used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hotfix Fix some bug(s) introduced by recently merged commit(s)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants