Register v8 debugger as async event delegate when tracing [v8/v8 : main]

0 views
Skip to first unread message

Andres Olivares (Gerrit)

unread,
Dec 6, 2024, 8:07:15 AM12/6/24
to Benedikt Meurer, Simon Zünd, V8 LUCI CQ, devtools-...@chromium.org, v8-re...@googlegroups.com
Attention needed from Benedikt Meurer and Simon Zünd

Andres Olivares voted and added 1 comment

Votes added by Andres Olivares

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Andres Olivares . resolved

PTAL

Open in Gerrit

Related details

Attention is currently required from:
  • Benedikt Meurer
  • Simon Zünd
Submit Requirements:
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: Ifc3f69dba40266a94ab78bef9d145fcce1f3ca50
Gerrit-Change-Number: 6076559
Gerrit-PatchSet: 2
Gerrit-Owner: Andres Olivares <and...@chromium.org>
Gerrit-Reviewer: Andres Olivares <and...@chromium.org>
Gerrit-Reviewer: Benedikt Meurer <bme...@chromium.org>
Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
Gerrit-Attention: Simon Zünd <szu...@chromium.org>
Gerrit-Attention: Benedikt Meurer <bme...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Dec 2024 13:07:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Simon Zünd (Gerrit)

unread,
Dec 9, 2024, 12:59:52 AM12/9/24
to Andres Olivares, Benedikt Meurer, V8 LUCI CQ, devtools-...@chromium.org, v8-re...@googlegroups.com
Attention needed from Andres Olivares and Benedikt Meurer

Simon Zünd added 1 comment

Commit Message
Line 10, Patchset 2 (Latest):called when tracing as the optimized path prevents calling into this
when no async event delegate is registered [1]. The implementation of
Simon Zünd . unresolved

This is very much on purpose. Transitioning from JS to C++ and back into JS is very costly. Installing an async event delegate means that a lot of code paths will revert to the slow-path, and in the worst case cause deopts. Adding this additional async/promise instrumentation will heavily skew async/promise-heavy code vs plain sync code in performance profiles.

Did you run some benchmarks to measure what the overhead is, and if the performance hit is acceptable?

Open in Gerrit

Related details

Attention is currently required from:
  • Andres Olivares
  • Benedikt Meurer
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifc3f69dba40266a94ab78bef9d145fcce1f3ca50
    Gerrit-Change-Number: 6076559
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Benedikt Meurer <bme...@chromium.org>
    Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
    Gerrit-Attention: Andres Olivares <and...@chromium.org>
    Gerrit-Attention: Benedikt Meurer <bme...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Dec 2024 05:59:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Andres Olivares (Gerrit)

    unread,
    Dec 9, 2024, 4:49:16 AM12/9/24
    to Benedikt Meurer, Simon Zünd, V8 LUCI CQ, devtools-...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Benedikt Meurer and Simon Zünd

    Andres Olivares added 1 comment

    Commit Message
    Line 10, Patchset 2 (Latest):called when tracing as the optimized path prevents calling into this
    when no async event delegate is registered [1]. The implementation of
    Simon Zünd . unresolved

    This is very much on purpose. Transitioning from JS to C++ and back into JS is very costly. Installing an async event delegate means that a lot of code paths will revert to the slow-path, and in the worst case cause deopts. Adding this additional async/promise instrumentation will heavily skew async/promise-heavy code vs plain sync code in performance profiles.

    Did you run some benchmarks to measure what the overhead is, and if the performance hit is acceptable?

    Andres Olivares

    I was assuming the callpaths enabled by this would be the ones that start from the call to trace (given the still valid early return in the async task instrumentation methods), but it seems this is not the case given that the call into C++ wouldn't happen otherwise? Do you have a benchmark you can recommend we test the impact of this change with?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Benedikt Meurer
    • Simon Zünd
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifc3f69dba40266a94ab78bef9d145fcce1f3ca50
    Gerrit-Change-Number: 6076559
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Benedikt Meurer <bme...@chromium.org>
    Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
    Gerrit-Attention: Simon Zünd <szu...@chromium.org>
    Gerrit-Attention: Benedikt Meurer <bme...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Dec 2024 09:49:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Simon Zünd <szu...@chromium.org>
    unsatisfied_requirement
    open
    diffy

    Andres Olivares (Gerrit)

    unread,
    Dec 9, 2024, 5:37:34 AM12/9/24
    to Simon Zünd, V8 LUCI CQ, devtools-...@chromium.org, v8-re...@googlegroups.com

    Andres Olivares abandoned this change

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: abandon
    unsatisfied_requirement
    open
    diffy

    Benedikt Meurer (Gerrit)

    unread,
    Dec 16, 2024, 1:54:19 AM12/16/24
    to Andres Olivares, Simon Zünd, V8 LUCI CQ, devtools-...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Andres Olivares

    Benedikt Meurer added 1 comment

    File src/inspector/v8-debugger.cc
    Line 1056, Patchset 2 (Latest): v8::debug::SetAsyncEventDelegate(
    Benedikt Meurer . unresolved

    Are you sure that this method will (re)run when tracing is enabled?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andres Olivares
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifc3f69dba40266a94ab78bef9d145fcce1f3ca50
    Gerrit-Change-Number: 6076559
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Benedikt Meurer <bme...@chromium.org>
    Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
    Gerrit-Attention: Andres Olivares <and...@chromium.org>
    Gerrit-Comment-Date: Mon, 16 Dec 2024 06:54:14 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Simon Zünd (Gerrit)

    unread,
    Dec 16, 2024, 2:07:48 AM12/16/24
    to Andres Olivares, V8 LUCI CQ, devtools-...@chromium.org, v8-re...@googlegroups.com
    Attention needed from Andres Olivares

    Simon Zünd added 1 comment

    File src/inspector/v8-debugger.cc
    Line 1056, Patchset 2 (Latest): v8::debug::SetAsyncEventDelegate(
    Benedikt Meurer . unresolved

    Are you sure that this method will (re)run when tracing is enabled?

    Simon Zünd

    I think it's more of a side-effect that DevTools explicitly disables the debugger before starting the profiler.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andres Olivares
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifc3f69dba40266a94ab78bef9d145fcce1f3ca50
    Gerrit-Change-Number: 6076559
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Benedikt Meurer <bme...@chromium.org>
    Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
    Gerrit-Attention: Andres Olivares <and...@chromium.org>
    Gerrit-Comment-Date: Mon, 16 Dec 2024 07:07:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Benedikt Meurer <bme...@chromium.org>
    unsatisfied_requirement
    open
    diffy

    Andres Olivares (Gerrit)

    unread,
    Dec 17, 2024, 3:55:06 AM12/17/24
    to Simon Zünd, V8 LUCI CQ, devtools-...@chromium.org, v8-re...@googlegroups.com

    Andres Olivares added 1 comment

    File src/inspector/v8-debugger.cc
    Line 1056, Patchset 2 (Latest): v8::debug::SetAsyncEventDelegate(
    Benedikt Meurer . resolved

    Are you sure that this method will (re)run when tracing is enabled?

    Simon Zünd

    I think it's more of a side-effect that DevTools explicitly disables the debugger before starting the profiler.

    Andres Olivares

    I've tested this locally and it works, likely through the call path Simon mentions. But in any case, I've abandoned this change until we have a better idea of its usefuleness and impact in performance to determine if it's worth landing. Thanks!

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: v8/v8
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifc3f69dba40266a94ab78bef9d145fcce1f3ca50
    Gerrit-Change-Number: 6076559
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Andres Olivares <and...@chromium.org>
    Gerrit-Reviewer: Benedikt Meurer <bme...@chromium.org>
    Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Dec 2024 08:54:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Simon Zünd <szu...@chromium.org>
    Comment-In-Reply-To: Benedikt Meurer <bme...@chromium.org>
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages