Closed Bug 1526958 Opened 1 year ago Closed 1 year ago

Optimize mozilla::dom::TouchEvent::PrefEnabled(nsIDocShell*)

Categories

(Core :: Web Painting, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: miko, Assigned: miko)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This function dereferences a lot of static variables, which seems hurt CPU cache behavior. During display list building, this function is called from nsIFrame::GetCompositorHitTestInfo()1.

Assignee: nobody → mikokm
Status: NEW → ASSIGNED

This patch changes the CrashReporter annotation behavior slightly by adding the HasDeviceTouchScreen annotation also in situations where autodetection is not used.

Priority: P1 → P2

Shouldn't we cache the value in nsDisplayListBuilder or PresShell, and the cached value would be valid only during one paint?

Attachment #9044908 - Attachment description: Bug 1526958 - Avoid static variable lookups in mozilla::dom::TouchEvent::PrefEnabled(nsIDocShell*) → Bug 1526958 - Cache dom::TouchEvent::PrefEnabled in nsDisplayListBuilder

(In reply to Olli Pettay [:smaug] from comment #3)

Shouldn't we cache the value in nsDisplayListBuilder or PresShell, and the cached value would be valid only during one paint?

This is a good idea. I have changed the patch to do that.

Pushed by mikokm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/ba13685290ee
Cache dom::TouchEvent::PrefEnabled in nsDisplayListBuilder r=mattwoodrow
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.