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

Issue 1611413005: Make HTMLSlotElement.distributedNodeNextTo&distributedNodePreviousTo faster (Closed)

Created:
4 years, 11 months ago by yuzuchan
Modified:
4 years, 10 months ago
Reviewers:
kojii, hayato, yuzusan, kochi
CC:
chromium-reviews, blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make HTMLSlotElement.distributedNodeNextTo & distributedNodePreviousTo faster Currently distributedNodeNextTo & distributedNodePreviousTo are calculated using vector (O(N)). This CL makes this calculation O(1) by introducing a hashmap. According to Performance Test, the calculation became 7.7% faster, in case of N=1000. (N being the number of distributed nodes) With this CL: avg 79094.69485003888 runs/s Without this CL: avg 73466.4783609413 runs/s BUG=531990 Committed: https://crrev.com/429b5ee96832287dd7c0747e6115227ac2447b31 Cr-Commit-Position: refs/heads/master@{#372632}

Patch Set 1 #

Patch Set 2 : Remove an unintended change #

Patch Set 3 : Add Performance Test #

Total comments: 18

Patch Set 4 : Clean up code #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -6 lines) Patch
A third_party/WebKit/PerformanceTests/ShadowDOM/SlotDistibutedNextPrevious.html View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLSlotElement.h View 1 2 3 2 chunks +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLSlotElement.cpp View 1 2 3 2 chunks +21 lines, -4 lines 1 comment Download

Messages

Total messages: 16 (6 generated)
yuzuchan
4 years, 10 months ago (2016-01-26 05:15:46 UTC) #3
kochi
At first glance I thought this can also be achieved using WTF::DoublyLinkedList<T>, but noticed that ...
4 years, 10 months ago (2016-01-27 08:29:14 UTC) #4
kochi
https://codereview.chromium.org/1611413005/diff/40001/third_party/WebKit/Source/core/html/HTMLSlotElement.h File third_party/WebKit/Source/core/html/HTMLSlotElement.h (left): https://codereview.chromium.org/1611413005/diff/40001/third_party/WebKit/Source/core/html/HTMLSlotElement.h#oldcode53 third_party/WebKit/Source/core/html/HTMLSlotElement.h:53: // TODO(hayato): This takes O(N). Make it O(1) with ...
4 years, 10 months ago (2016-01-27 10:53:15 UTC) #5
yuzuchan
https://codereview.chromium.org/1611413005/diff/40001/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp File third_party/WebKit/Source/core/html/HTMLSlotElement.cpp (right): https://codereview.chromium.org/1611413005/diff/40001/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp#newcode95 third_party/WebKit/Source/core/html/HTMLSlotElement.cpp:95: for (WillBeHeapHashMap<RawPtrWillBeMember<const Node>, size_t>::const_iterator it = other.m_distributedIndices.begin(); it != ...
4 years, 10 months ago (2016-02-01 05:40:42 UTC) #6
kochi
lgtm https://codereview.chromium.org/1611413005/diff/60001/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp File third_party/WebKit/Source/core/html/HTMLSlotElement.cpp (right): https://codereview.chromium.org/1611413005/diff/60001/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp#newcode110 third_party/WebKit/Source/core/html/HTMLSlotElement.cpp:110: const auto& it = m_distributedIndices.find(&node); Yeah, 'const auto&' ...
4 years, 10 months ago (2016-02-01 06:12:15 UTC) #7
hayato
lgtm LGTM > According to Performance Test, the calculation became 7.7% faster, in case of ...
4 years, 10 months ago (2016-02-01 09:16:00 UTC) #8
yuzusan
On 2016/02/01 09:16:00, hayato wrote: > lgtm > > LGTM > > > According to ...
4 years, 10 months ago (2016-02-01 09:20:46 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1611413005/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1611413005/60001
4 years, 10 months ago (2016-02-01 09:23:38 UTC) #12
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 10 months ago (2016-02-01 10:22:38 UTC) #14
commit-bot: I haz the power
4 years, 10 months ago (2016-02-01 10:23:28 UTC) #16
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/429b5ee96832287dd7c0747e6115227ac2447b31
Cr-Commit-Position: refs/heads/master@{#372632}

Powered by Google App Engine
This is Rietveld 408576698