Closed
Bug 1237714
Opened 8 years ago
Closed 8 years ago
nsContentUtils::IsCustomElementName is slower than it should be
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
It's doing 2 checks like so: 2779 if (NS_FAILED(nsContentUtils::CheckQName(str, false, &colon)) || colon || 2780 str.FindChar('-') == -1) { 2781 return false; but in practice the CheckQName() call will always return success, there will almost never be a colon and there will almost never be a '-'. So why aren't we checking for the '-' first and skipping the expensive CheckQName call in the common case of there being no '-'?
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8705468 -
Flags: review?(bugs)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•8 years ago
|
||
I did check that this makes IsCustomElementName almost disappear from my profile in bug 1232023.
Updated•8 years ago
|
Attachment #8705468 -
Flags: review?(bugs) → review+
Comment 4•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8fc13f4bc59e
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•