Closed Bug 1338887 Opened 7 years ago Closed 7 years ago

nsRefreshDriver::DispatchAnimationEvents() should use AutoTArray to avoid allocations in common cases

Categories

(Core :: Layout, defect)

36 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(1 file)

I was profiling something else, but nsRefreshDriver::DispatchAnimationEvents() showed up there because of the allocations it does.

We could probably use reasonable large AutoTArray here, perhaps size 32?
Assignee: nobody → bugs
Attachment #8836461 - Flags: review?(mantaroh)
Comment on attachment 8836461 [details] [diff] [review]
animation_events.diff

Review of attachment 8836461 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, Olli.

Looks good to me.

Like this, print events are using the same implementation. (i.e. nsCOMArray instead AutoTArray) [1] 
[1] https://dxr.mozilla.org/mozilla-central/rev/0eef1d5a39366059677c6d7944cfe8a97265a011/layout/base/nsDocumentViewer.cpp#429-447

Should we change this implementation?
Attachment #8836461 - Flags: review?(mantaroh) → review+
Sure, but print events are very rarely used feature, so doesn't matter too much. DispatchAnimationEvents is being called all the time.
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8ce55d187ed5
try to avoid extra allocations when dispatching animation events, r=mantaroh
https://hg.mozilla.org/mozilla-central/rev/8ce55d187ed5
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
See Also: → 1367981
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: