Opened 11 years ago

Closed 10 years ago

#2332 closed patch (WontFix)

Speed optimizations to torrent.get_status

Reported by: bro Owned by:
Priority: minor Milestone: performance
Component: Core Version: develop
Keywords: Cc:

Description

Optimized torrent.get_status by keeping track of if the torrent status has been updated since last call. If not, use the the previous values instead of calling the status functions.

I've tested loading deluged with 1000 torrents and connecting thin client and leaving it running for 2 minutes. The number of calls to get_status is around 250000 Current get_status used a total of 15 seconds CPU, while this version used 6 seconds. According to cProfile the average runtime is reduced from 60 to 20 microseconds.

The downside is that the code is a bit more verbose.

https://github.com/bendikro/deluge/commits/develop-torrent-get-status-speedup

Change History (1)

comment:1 Changed 10 years ago by bro

  • Resolution set to WontFix
  • Status changed from new to closed

Branch has been abandoned as the modifications had some unsolved bugs which I didn't care to fix. Also the changes were a bit verbose (many lines of code for different cases).

Note: See TracTickets for help on using tickets.