Opened 12 years ago

Closed 12 years ago

#3291 closed Enhancement (fixed)

tr_torrent.infoDictOffset should be lazy-set

Reported by: charles Owned by: charles
Priority: Normal Milestone: 2.01
Component: libtransmission Version: 1.93
Severity: Normal Keywords:
Cc:

Description (last modified by charles)

Initializing these this fields is expensive and slows down startup when loading in a lot of torrents. On Linux, this process is the #2 CPU hit shown by cachegrind. (qsort is #1)

This field is also used only when sending metainfo to a peer. This won't be used at all for private torrents. Even for public torrents, this doesn't need to be loaded at startup.

By setting this field only when we need it for the first time, we can avoid a big CPU hit on startup.

Attachments (2)

infoDictOffset.diff (8.8 KB) - added by charles 12 years ago.
infoDictOffset.r2.diff (8.8 KB) - added by charles 12 years ago.
cleaner diff

Download all attachments as: .zip

Change History (6)

comment:1 Changed 12 years ago by charles

  • Component changed from Transmission to libtransmission
  • Description modified (diff)
  • Owner set to charles
  • Status changed from new to assigned
  • Summary changed from tr_torrent.infoDictOffset and tr_torrent.infoDictLength should be lazy-created to tr_torrent.infoDictOffset should be lazy-set

Changed 12 years ago by charles

comment:2 Changed 12 years ago by charles

  • Milestone changed from Sometime to 2.10

Changed 12 years ago by charles

cleaner diff

comment:3 Changed 12 years ago by charles

  • Milestone changed from 2.10 to 2.01

comment:4 Changed 12 years ago by charles

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

Fixed in trunk for 2.01 by r10774

Note: See TracTickets for help on using tickets.