Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4369 closed Bug (fixed)

Typing text into the main window's filter field causes high CPU

Reported by: jordan Owned by: jordan
Priority: Normal Milestone: 2.33
Component: Qt Client Version: 2.32
Severity: Normal Keywords:


Summary says it all.

The high CPU load seems to be coming from mktime() being called by QDateTime::operator< in this trace:

#4  0x00007ffff48dc619 in mktime (tp=0x7ffff498b72b) at mktime.c:515
#5  0x00007ffff5404d05 in ?? () from /usr/lib/
#6  0x00007ffff5404e22 in QDateTime::operator<(QDateTime const&) const () from /usr/lib/
#7  0x0000000000459c19 in QDateTime::operator<= (this=0x7fffffffc360, other=...) at /usr/include/qt4/QtCore/qdatetime.h:259
#8  0x000000000045ff2b in Torrent::canManualAnnounce (this=0x81eb530, currentDateTime=...) at torrent.h:281
#9  0x000000000045670f in TrMainWindow::refreshActionSensitivity (this=0x921380) at

One possibility is to represent the MANUAL_ANNOUNCE_TIME property as a time_t rather than a QDateTime... however we use QDateTime for similar fields, so that would be a clumsy change unless the similar fields are changed too.

Another possibility is to add an idle timer so that action sensitivity is only recalculated after the user's done typing. The individual calls to Torrent::canManualAnnounce() will still be expensive, but there will be fewer of them.

Change History (3)

comment:1 Changed 10 years ago by jordan

  • Status changed from new to assigned

Fixed in r12557 by adding an idle timer when refreshing actions' sensitivity states.

comment:2 Changed 10 years ago by jordan

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

comment:3 Changed 10 years ago by jordan

  • Type changed from Enhancement to Bug
Note: See TracTickets for help on using tickets.