Closed Bug 955601 Opened 8 years ago Closed 8 years ago

Bubbles' updateLastInsertTime function wastes a lot of time setting and clearing timeouts

Categories

(Instantbird :: Conversation, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: florian, Assigned: florian)

Details

Attachments

(1 file)

*** Original post on bio 2161 at 2013-09-07 18:28:00 UTC ***

*** Due to BzAPI limitations, the initial description is in comment 1 ***
Attached patch PatchSplinter Review
*** Original post on bio 2161 as attmnt 2847 at 2013-09-07 18:28:00 UTC ***

I profiles the display of a large conversation log, and updateLastInsertTime appeared at 1.5-2.5% in the profiles, which surprised me (this is about the same amount of time as what we do in setColors, which does plenty of dom manipulations).

After looking into how the time was spent by this function, it turns out it pointlessly cancels and creates plenty of 0ms timers.

After applying the attached patch, the function still shows up in profiles, but it was at 0.2%, and the time spent in it was mostly in DOM manipulations (getting the insert element and the time attribute) and setting JS variables.
Attachment #8354617 - Flags: review?(aleth)
Comment on attachment 8354617 [details] [diff] [review]
Patch

*** Original change on bio 2161 attmnt 2847 at 2013-09-07 18:40:49 UTC ***

Thanks for this speedup! 2% wins add up :)
Attachment #8354617 - Flags: review?(aleth) → review+
OS: Other → All
Hardware: x86 → All
Whiteboard: [checkin-needed]
*** Original post on bio 2161 at 2013-09-09 23:36:53 UTC ***

http://hg.instantbird.org/instantbird/rev/644a37f59e3e
Assignee: nobody → florian
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [checkin-needed]
Target Milestone: --- → 1.5
You need to log in before you can comment on or make changes to this bug.