If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

nsRange::GetCommonAncestor() is expensive for the obvious case

RESOLVED FIXED in Firefox 56

Status

()

Core
DOM
RESOLVED FIXED
2 months ago
2 months ago

People

(Reporter: Ehsan, Unassigned)

Tracking

(Blocks: 1 bug)

unspecified
mozilla56
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment)

For text controls, the start and end of the container is the same often times, but because the nsContentUtils API doesn't get inlines, nsRange::GetCommonAncestor() shows up in profiles of bug 1346723.

GetCommonAncestorInternal() is a template, so we already have two copies of this check: https://searchfox.org/mozilla-central/rev/09c065976fd4f18d4ad764d7cb4bbc684bf56714/dom/base/nsContentUtils.cpp#2709.  So we may as well inline them in the header to get them to the caller side instead so that we make the common case for these situations faster.
Created attachment 8891597 [details] [diff] [review]
Inline the check for common argument in the callers of GetCommonAncestorInternal()
Attachment #8891597 - Flags: review?(amarchesini)
Attachment #8891597 - Flags: review?(amarchesini) → review+

Comment 2

2 months ago
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/76abbe45dd0a
Inline the check for common argument in the callers of GetCommonAncestorInternal(); r=baku

Comment 3

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