Skip to content

Further optimize handling of torrents with large number of files#710

Merged
equeim merged 12 commits intomasterfrom
torrent-files-optimization
Apr 9, 2026
Merged

Further optimize handling of torrents with large number of files#710
equeim merged 12 commits intomasterfrom
torrent-files-optimization

Conversation

@equeim
Copy link
Copy Markdown
Owner

@equeim equeim commented Apr 8, 2026

  1. Don't recursively calculate properties of a directory every time they are accessed, do it only the first time and store them, and update them when they change
  2. Don't use polymorphism for TorrentFilesModelEntry. Instead store file or directory data in it directory using std::variant. This allows storing entries in contiguous vectors in directories instead of allocating each one separately and storing pointers.
  3. Don't split file paths into std::vector each time they are parsed from JSON, do it only once when building file tree.

@equeim equeim force-pushed the torrent-files-optimization branch from 2577b03 to 72516cf Compare April 9, 2026 19:59
@equeim equeim merged commit 38bc5dd into master Apr 9, 2026
30 checks passed
@equeim equeim deleted the torrent-files-optimization branch April 9, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant