Closed Bug 493168 Opened 15 years ago Closed 15 years ago

Wasting CPU cycles with refreshing download info for non-active downloads

Categories

(Camino Graveyard :: Downloading, defect)

All
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino2.0

People

(Reporter: ishermandom+bugs, Assigned: ishermandom+bugs)

References

Details

Attachments

(1 file, 1 obsolete file)

2.40 KB, patch
ishermandom+bugs
: review+
mikepinkerton
: superreview+
Details | Diff | Splinter Review
Attached patch Patch (obsolete) — Splinter Review
AFAICT, the timer we use to refresh download info in |ProgressDlgController| is really just meant to be used to animate downloads-in-progress.  Currently, the timer keeps calling |refreshDownloadInfo| on every single download, even when there are no active downloads remaining.  With a bunch of downloads in progress, this can have a noticeable impact on CPU use.

I'm not sure if this is best place to add |killTimer|, but given what I know about how the timer works, it seems likely to be an o.k. place to do it.  The other reasonable option I can think of is to check for how many active downloads remain each time |didEndDownload| is called.
Attachment #377629 - Flags: review?(stuart.morgan+bugzilla)
Flags: camino2.0b3?
Not a blocker for b3, but marking 2.0
Flags: camino2.0b3? → camino2.0b3-
Target Milestone: --- → Camino2.0
Comment on attachment 377629 [details] [diff] [review]
Patch

Makes sense, and all the cases other than progress that I can think of (completion, file is moved away, pause/resume) already have explicit calls to refreshDownloadInfo. I agree this is a reasonable place to kill the timer.

One thing though: I believe that a paused download is considered "active", which means if there's a paused download in the list it'll keep getting refreshed and the timer won't go away. I believe that you also want to check ![curController isPaused] in your look, and then have a call in resume: to setupDownloadTimer. That would need testing though; I'm just going by code here.

r=me, with or without that change depending on what you find.
Attachment #377629 - Flags: review?(stuart.morgan+bugzilla) → review+
Attached patch Patch v2Splinter Review
Also attends to paused downloads
Attachment #377629 - Attachment is obsolete: true
Attachment #378978 - Flags: superreview?
Attachment #378978 - Flags: review+
Attachment #378978 - Flags: superreview? → superreview?(mikepinkerton)
Comment on attachment 378978 [details] [diff] [review]
Patch v2

sr=pink
Attachment #378978 - Flags: superreview?(mikepinkerton) → superreview+
Landed on cvs trunk.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: