Faster manual slot assignment [chromium/src : main]

0 views
Skip to first unread message

Aleks Totic (Gerrit)

unread,
Sep 25, 2021, 2:45:29 PM9/25/21
to Mason Freed, blink-rev...@chromium.org, blink-...@chromium.org

Attention is currently required from: Mason Freed.

Aleks Totic would like Mason Freed to review this change.

View Change

Faster manual slot assignment

Fix for 30% regression in
linux-perf/blink_perf.shadow_dom/imperative-api-detail-summary-large/imperative-api-detail-summary-large.html

Do not assign slots that have already been assigned.

Bug: 1251041
Change-Id: Ia500af5f34acfae5e07472e7ecf0c7b0c9e89289
---
M third_party/blink/renderer/core/html/html_details_element.cc
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/third_party/blink/renderer/core/html/html_details_element.cc b/third_party/blink/renderer/core/html/html_details_element.cc
index d6c4b93..92505acb 100644
--- a/third_party/blink/renderer/core/html/html_details_element.cc
+++ b/third_party/blink/renderer/core/html/html_details_element.cc
@@ -161,14 +161,14 @@
if (!child.IsSlotable())
continue;
if (IsFirstSummary(child)) {
- summary_nodes.push_back(child);
+ if (child.ManuallyAssignedSlot() != summary_slot)
+ summary_nodes.push_back(child);
} else {
- content_nodes.push_back(child);
+ if (child.ManuallyAssignedSlot() != content_slot)
+ content_nodes.push_back(child);
}
}
- summary_slot->ClearAssignedNodes();
summary_slot->Assign(summary_nodes);
- content_slot->ClearAssignedNodes();
content_slot->Assign(content_nodes);
}


To view, visit change 3184021. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia500af5f34acfae5e07472e7ecf0c7b0c9e89289
Gerrit-Change-Number: 3184021
Gerrit-PatchSet: 1
Gerrit-Owner: Aleks Totic <ato...@chromium.org>
Gerrit-Reviewer: Aleks Totic <ato...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-MessageType: newchange

Aleks Totic (Gerrit)

unread,
Sep 25, 2021, 2:45:35 PM9/25/21
to blink-rev...@chromium.org, blink-...@chromium.org, Mason Freed, Chromium LUCI CQ, Pinpoint perf, chromium...@chromium.org

Attention is currently required from: Mason Freed.

View Change

1 comment:

  • Patchset:

To view, visit change 3184021. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia500af5f34acfae5e07472e7ecf0c7b0c9e89289
Gerrit-Change-Number: 3184021
Gerrit-PatchSet: 1
Gerrit-Owner: Aleks Totic <ato...@chromium.org>
Gerrit-Reviewer: Aleks Totic <ato...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Comment-Date: Sat, 25 Sep 2021 18:45:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Mason Freed (Gerrit)

unread,
Sep 25, 2021, 5:09:31 PM9/25/21
to Aleks Totic, blink-rev...@chromium.org, blink-...@chromium.org, Chromium LUCI CQ, Pinpoint perf, chromium...@chromium.org

Attention is currently required from: Aleks Totic.

View Change

1 comment:

  • Patchset:

    • Patch Set #1:

      Hmm, the code looks good, but from the tests, it broke the <details>. The summary element is wrong. I don't see the bug...

To view, visit change 3184021. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia500af5f34acfae5e07472e7ecf0c7b0c9e89289
Gerrit-Change-Number: 3184021
Gerrit-PatchSet: 1
Gerrit-Owner: Aleks Totic <ato...@chromium.org>
Gerrit-Reviewer: Aleks Totic <ato...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Aleks Totic <ato...@chromium.org>
Gerrit-Comment-Date: Sat, 25 Sep 2021 21:09:20 +0000

Aleks Totic (Gerrit)

unread,
Sep 27, 2021, 3:44:25 AM9/27/21
to blink-rev...@chromium.org, blink-...@chromium.org, Mason Freed, Chromium LUCI CQ, Pinpoint perf, chromium...@chromium.org

Attention is currently required from: Mason Freed.

View Change

1 comment:

  • Patchset:

    • Patch Set #1:

      Hmm, the code looks good, but from the tests, it broke the <details>. The summary element is wrong. […]

      It turns out code wrong, I misunderstood Assign() API.
      Now that I've fixed it, it is only 2ms faster.
      I needed to make up 11ms for parity.

      My current hypothesis is that manually assigned nodes might be
      inherently slower.

      My next step is to do a pprof profile and see where the time goes.

To view, visit change 3184021. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia500af5f34acfae5e07472e7ecf0c7b0c9e89289
Gerrit-Change-Number: 3184021
Gerrit-PatchSet: 1
Gerrit-Owner: Aleks Totic <ato...@chromium.org>
Gerrit-Reviewer: Aleks Totic <ato...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Sep 2021 07:44:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
Gerrit-MessageType: comment

Mason Freed (Gerrit)

unread,
Sep 27, 2021, 11:00:02 AM9/27/21
to Aleks Totic, blink-rev...@chromium.org, blink-...@chromium.org, Chromium LUCI CQ, Pinpoint perf, chromium...@chromium.org

Attention is currently required from: Aleks Totic.

View Change

1 comment:

  • Patchset:

    To view, visit change 3184021. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia500af5f34acfae5e07472e7ecf0c7b0c9e89289
    Gerrit-Change-Number: 3184021
    Gerrit-PatchSet: 1
    Gerrit-Owner: Aleks Totic <ato...@chromium.org>
    Gerrit-Reviewer: Aleks Totic <ato...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Attention: Aleks Totic <ato...@chromium.org>
    Gerrit-Comment-Date: Mon, 27 Sep 2021 14:59:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Aleks Totic <ato...@chromium.org>

    Aleks Totic (Gerrit)

    unread,
    Oct 5, 2021, 12:25:12 PM10/5/21
    to blink-rev...@chromium.org, blink-...@chromium.org, Mason Freed, Chromium LUCI CQ, Pinpoint perf, chromium...@chromium.org

    Aleks Totic abandoned this change.

    View Change

    Abandoned Bad patch

    To view, visit change 3184021. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia500af5f34acfae5e07472e7ecf0c7b0c9e89289
    Gerrit-Change-Number: 3184021
    Gerrit-PatchSet: 1
    Gerrit-Owner: Aleks Totic <ato...@chromium.org>
    Gerrit-Reviewer: Aleks Totic <ato...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-MessageType: abandon
    Reply all
    Reply to author
    Forward
    0 new messages