Skip to content

Extreme performance drop since 5.6 #1163

@koisama

Description

@koisama

I run instances of transmission-daemon that seed quite a few torrents, test instances had 17k and 56k.
The smaller 17k instance needs about 1 second of CPU time to load a list of torrents on 5.5.1. On 5.6 it needs 47 seconds of CPU time. Bigger 56k instance requires 5 seconds of CPU time with 5.5.1, and more than 10 minutes on 5.6.

I'm running it on windows 7 with transmission-daemon 2.93.
The issue is present in 5.6, 5.10, 5.13, 5.15.3, 5.15.4.
Versions 5.5.1, 5.4, 5.0.1 all work.
When built from source, 5.5.1 works as expected, 5.15.4 is extremely slow.

The culprit seems to be in main.pas:7157, repeated calls to FTorrents.IndexOf(idxTorrentId, ids[i]).
Optimizing it - calling FTorrents.IndexOf(idxTorrentId, ids[i]) once and using saved id later reduces loading time to ~1:50, but it's still too slow to be considered even remotely acceptable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions