Closed Bug 204005 Opened 22 years ago Closed 21 years ago

optimize caret timer usage

Categories

(Core :: DOM: Selection, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: leon.zhang, Assigned: mjudge)

References

(Blocks 2 open bugs)

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

(deleted), patch
sfraser_bugs
: review+
brendan
: superreview+
Details | Diff | Splinter Review
Blocks: 194343
No longer depends on: 194343
Blocks: 188318
In caret process, timer always be created in PrimeTimer each time, to enhance perf, we can reInit it and not create each time
Attached patch proposed fix (deleted) — Splinter Review
Attached patch a new patch (obsolete) (deleted) — Splinter Review
Comment on attachment 122165 [details] [diff] [review] a new patch I think StopBlinking should kill the timer.
Attachment #122165 - Flags: review-
The first patch looks good to me.
Oh, and the first patch seems OK on Mac OS X too.
pav, is re-initing repeating timers supported? If so, could we document that clearly in nsITimer.idl?
I remember a very serious problem in the 1.3a and 1.3b builds on Mac OS X, with timers that got re-inited : see bug 184363. The timer was the one used to show tooltips for title-tags. We had to back out that change, which was a shame, because it was a good performance speedup on pages with lots of title-tags on their links. The problem was probably that we were firing and re-initing timers in a very fast pace, which might have cuased multithreading problems. Are you sure that it's safe to re-init timers ?
I was aware of that tooltip timer issue, which is why I tested the patch here on OS X. If we declare that it's safe to re-init timers, I'd like to see a new 'reinit' method added to nsITimer, to make it clear to users of the API.
Attachment #122163 - Flags: superreview?(bz-bugspam)
Comment on attachment 122163 [details] [diff] [review] proposed fix bz, can give sr?
I will not be able to sr this in the near future, since I haven't convinced myself that it's safe to reinit the timer, and I do not have the time to read the bugs and code necessary to do that. "Near future" here is probably "until June 14".
According to comments and patches of bug 181961,it seems that timer can be ReInited in current trunk.
Attachment #122165 - Attachment is obsolete: true
Attachment #122163 - Flags: superreview?(bz-bugspam) → superreview?(brendan)
Keywords: perf
Comment on attachment 122163 [details] [diff] [review] proposed fix bz, I can sr this, but then I'm the one that made timer re-init work. If someone has doubts, please raise them with reference to specific code. I don't think this should go into 1.4final. I'm not planning to add a bunch of reinit methods to nsITimer, but I did add comments when I was there last to say that re-init works, and that it can be preferable to re-init, to save the overhead of destroying and recreating a timer. /be
Attachment #122163 - Flags: superreview?(brendan) → superreview+
fwiw, while experimenting with this, we did see odd results when reinitting precise timers; making the timer a slack timer allows reinit to work OK.
checked in
Status: NEW → RESOLVED
Closed: 21 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: