Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3955 closed Enhancement (fixed)

tr_torrentNext() should be inlined

Reported by: jordan Owned by: jordan
Priority: Normal Milestone: 2.20
Component: libtransmission Version: 2.13
Severity: Minor Keywords:
Cc:

Description (last modified by jordan)

This function shows up as using about 2% of transmission-gtk's runtime when profiled by perf(). It's not a major function, but it is low-hanging fruit.

Attachments (1)

torrent-next.diff (1.6 KB) - added by jordan 11 years ago.

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by jordan

comment:1 Changed 11 years ago by jordan

  • Description modified (diff)
  • Severity changed from Normal to Minor
  • Status changed from new to assigned

comment:2 Changed 11 years ago by jordan

  • Milestone changed from 2.30 to 2.21

comment:3 Changed 11 years ago by jordan

  • Milestone changed from 2.21 to 2.20

Promoting to 2.20 for a third beta, based on feedback from the other transmission devs

comment:4 Changed 11 years ago by jordan

  • Resolution set to fixed
  • Status changed from assigned to closed

r11781 -- added.

comment:5 Changed 11 years ago by ijuxda

This function shows up as using about 2% of transmission-gtk's runtime when profiled by perf().

Could it be because tr_torrentFindFromId() has linear time complexity?

Also, does inlining tr_torrentNext() actually improve performance, or does it just remove the function from the profiler's output? Some before-and-after benchmarks would be helpful for comparison.

comment:6 Changed 11 years ago by jordan

They all have linear time complexity, unfortunately. On startup, the lookup by hash seems most expensive. One solution would be for the session to have a sorted lookup based on the various keys.

Note: See TracTickets for help on using tickets.