Avoid a heap allocation per event during playback of blob images

RESOLVED FIXED in Firefox 57

Status

()

Core
Graphics: WebRender
RESOLVED FIXED
9 months ago
8 months ago

People

(Reporter: jrmuizel, Assigned: jrmuizel)

Tracking

(Blocks: 1 bug)

unspecified
mozilla57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

9 months ago
The heap allocation is not needed and not doing it will also help reduce contention with other threads.
(Assignee)

Comment 1

9 months ago
Created attachment 8888787 [details] [diff] [review]
Factor out a FOR_EACH_EVENT macro

This will let us avoid duplicating the event list for the upcoming DoWithEvent function.
Assignee: nobody → jmuizelaar
Attachment #8888787 - Flags: review?(lsalzman)
(Assignee)

Comment 2

9 months ago
Created attachment 8888792 [details] [diff] [review]
Add DoWithEvent

Add DoWithEvent which switches over an event type, reads the event into a stack variable and calls a callable with that event as a parameter.

This avoids doing a heap allocation for every event that we play back.
Attachment #8888792 - Flags: review?(lsalzman)

Updated

9 months ago
Attachment #8888792 - Flags: review?(lsalzman) → review+

Updated

9 months ago
Attachment #8888787 - Flags: review?(lsalzman) → review+
Blocks: 1386665

Comment 3

8 months ago
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f148f75bfc05
Factor out a FOR_EACH_EVENT macro. r=lsalzman
https://hg.mozilla.org/integration/mozilla-inbound/rev/8b5cf7fc54bf
RecordedEvent: Add DoWithEvent. r=lsalzman

Comment 4

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f148f75bfc05
https://hg.mozilla.org/mozilla-central/rev/8b5cf7fc54bf
Status: NEW → RESOLVED
Last Resolved: 8 months ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.