Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Issue 308963002: Minimize calls to Node::nodeType() as it is virtual (Closed)

Created:
6 years, 6 months ago by Inactive
Modified:
6 years, 6 months ago
Reviewers:
aandrey, eseidel
CC:
blink-reviews, eustas+blink_chromium.org, caseq+blink_chromium.org, loislo+blink_chromium.org, pfeldman+blink_chromium.org, malch+blink_chromium.org, sof, eae+blinkwatch, yurys+blink_chromium.org, lushnikov+blink_chromium.org, vsevik+blink_chromium.org, blink-reviews-dom_chromium.org, dglazkov+blink, paulirish+reviews_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, sergeyv+blink_chromium.org, aandrey+blink_chromium.org, rwlbuis
Visibility:
Public.

Description

Minimize calls to Node::nodeType() as it is virtual Minimize calls to Node::nodeType() as it is virtual and there are sometimes better alternative (i.e. Node flags). This patch leverages Node flags when possible (using methods such as isElementNode(), isDocumentFragment(), ...). It also caches the result of Node::nodeType() when suitable to avoid calling it several times in a row. R=eseidel@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175405

Patch Set 1 #

Patch Set 2 : Fix typo #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -30 lines) Patch
M Source/core/dom/Document.cpp View 1 chunk +2 lines, -2 lines 3 comments Download
M Source/core/dom/DocumentFragment.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Node.cpp View 2 chunks +4 lines, -4 lines 2 comments Download
M Source/core/dom/Range.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/inspector/DOMPatchSupport.cpp View 2 chunks +7 lines, -7 lines 0 comments Download
M Source/core/inspector/InspectorController.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorDOMAgent.cpp View 1 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/inspector/InspectorStyleSheet.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/XPathStep.cpp View 2 chunks +12 lines, -9 lines 0 comments Download
M Source/core/xml/XPathUtil.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Inactive
6 years, 6 months ago (2014-06-02 13:44:20 UTC) #1
aandrey
FYI https://codereview.chromium.org/308963002/diff/20001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/308963002/diff/20001/Source/core/dom/Document.cpp#newcode3337 Source/core/dom/Document.cpp:3337: for (Node* c = toDocumentFragment(newChild).firstChild(); c; c = ...
6 years, 6 months ago (2014-06-02 14:50:51 UTC) #2
Inactive
https://codereview.chromium.org/308963002/diff/20001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/308963002/diff/20001/Source/core/dom/Document.cpp#newcode3337 Source/core/dom/Document.cpp:3337: for (Node* c = toDocumentFragment(newChild).firstChild(); c; c = c->nextSibling()) ...
6 years, 6 months ago (2014-06-02 15:48:02 UTC) #3
Inactive
https://codereview.chromium.org/308963002/diff/20001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/308963002/diff/20001/Source/core/dom/Document.cpp#newcode3337 Source/core/dom/Document.cpp:3337: for (Node* c = toDocumentFragment(newChild).firstChild(); c; c = c->nextSibling()) ...
6 years, 6 months ago (2014-06-02 15:49:02 UTC) #4
Inactive
Eric, what do you think about this one?
6 years, 6 months ago (2014-06-03 19:19:01 UTC) #5
eseidel
lgtm
6 years, 6 months ago (2014-06-03 19:37:54 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/308963002/20001
6 years, 6 months ago (2014-06-03 19:38:45 UTC) #7
commit-bot: I haz the power
6 years, 6 months ago (2014-06-03 20:38:01 UTC) #8
Message was sent while issue was closed.
Change committed as 175405

Powered by Google App Engine
This is Rietveld 408576698