WebAudio: Add UMA for AudioHandler Process Time Ratio [chromium/src : main]

0 views
Skip to first unread message

Alvin Ji (Gerrit)

unread,
Jun 16, 2025, 3:26:14 PMJun 16
to Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Hongchan Choi, asvitkine...@chromium.org, blink-...@chromium.org
Attention needed from Michael Wilson

Alvin Ji added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Alvin Ji . resolved

Hi Michael,
PTAL and thanks!
Alvin

Open in Gerrit

Related details

Attention is currently required from:
  • Michael Wilson
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • 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: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I198c14ac7de3ec7f4a1f7d4b52a817a881a4af86
Gerrit-Change-Number: 6641781
Gerrit-PatchSet: 2
Gerrit-Owner: Alvin Ji <alv...@chromium.org>
Gerrit-Reviewer: Alvin Ji <alv...@chromium.org>
Gerrit-Reviewer: Michael Wilson <mjwi...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Hongchan Choi <hong...@chromium.org>
Gerrit-Attention: Michael Wilson <mjwi...@chromium.org>
Gerrit-Comment-Date: Mon, 16 Jun 2025 19:25:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael Wilson (Gerrit)

unread,
Jun 16, 2025, 6:58:57 PMJun 16
to Alvin Ji, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Hongchan Choi, asvitkine...@chromium.org, blink-...@chromium.org
Attention needed from Alvin Ji

Michael Wilson added 1 comment

File tools/metrics/histograms/metadata/web_audio/histograms.xml
Line 43, Patchset 2 (Latest): <variant name="PannerNode"/>
Michael Wilson . unresolved

[PannerNode](https://crsrc.org/c/third_party/blink/renderer/modules/webaudio/panner_handler.cc) has a custom ProcessIfNecessary, we probably need to add code there too.

Open in Gerrit

Related details

Attention is currently required from:
  • Alvin Ji
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • 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: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I198c14ac7de3ec7f4a1f7d4b52a817a881a4af86
    Gerrit-Change-Number: 6641781
    Gerrit-PatchSet: 2
    Gerrit-Owner: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Michael Wilson <mjwi...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Hongchan Choi <hong...@chromium.org>
    Gerrit-Attention: Alvin Ji <alv...@chromium.org>
    Gerrit-Comment-Date: Mon, 16 Jun 2025 22:58:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alvin Ji (Gerrit)

    unread,
    Jun 17, 2025, 5:42:28 PMJun 17
    to Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Hongchan Choi, asvitkine...@chromium.org, blink-...@chromium.org
    Attention needed from Michael Wilson

    Alvin Ji added 1 comment

    File tools/metrics/histograms/metadata/web_audio/histograms.xml
    Line 43, Patchset 2: <variant name="PannerNode"/>
    Michael Wilson . resolved

    [PannerNode](https://crsrc.org/c/third_party/blink/renderer/modules/webaudio/panner_handler.cc) has a custom ProcessIfNecessary, we probably need to add code there too.

    Alvin Ji

    Thanks for pointing this out, I added the same logic to `PannerHandler::ProcessIfNecessary`.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Wilson
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I198c14ac7de3ec7f4a1f7d4b52a817a881a4af86
    Gerrit-Change-Number: 6641781
    Gerrit-PatchSet: 3
    Gerrit-Owner: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Michael Wilson <mjwi...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Hongchan Choi <hong...@chromium.org>
    Gerrit-Attention: Michael Wilson <mjwi...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 21:42:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Michael Wilson <mjwi...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Wilson (Gerrit)

    unread,
    Jun 17, 2025, 7:05:37 PMJun 17
    to Alvin Ji, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Hongchan Choi, asvitkine...@chromium.org, blink-...@chromium.org
    Attention needed from Alvin Ji

    Michael Wilson voted and added 2 comments

    Votes added by Michael Wilson

    Code-Review+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 3 (Latest):
    Michael Wilson . resolved

    LGTM mod possible datatype change.

    File third_party/blink/renderer/modules/webaudio/audio_handler.h
    Line 72, Patchset 3 (Latest): uint32_t total_process_frames_ = 0;
    Michael Wilson . unresolved

    I'm not sure if this is important, but I think that at 48000 samples per second this would roll over after about 1 day (2^32 / (48000 * 60 * 60 * 24)). Probably longer than most AudioContexts survive, but not impossible to see. We may want to do uint64_t instead.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alvin Ji
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I198c14ac7de3ec7f4a1f7d4b52a817a881a4af86
    Gerrit-Change-Number: 6641781
    Gerrit-PatchSet: 3
    Gerrit-Owner: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Michael Wilson <mjwi...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Hongchan Choi <hong...@chromium.org>
    Gerrit-Attention: Alvin Ji <alv...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 23:05:25 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alvin Ji (Gerrit)

    unread,
    Jun 17, 2025, 7:17:56 PMJun 17
    to Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Hongchan Choi, asvitkine...@chromium.org, blink-...@chromium.org
    Attention needed from Michael Wilson

    Alvin Ji added 1 comment

    File third_party/blink/renderer/modules/webaudio/audio_handler.h
    Line 72, Patchset 3 (Latest): uint32_t total_process_frames_ = 0;
    Michael Wilson . unresolved

    I'm not sure if this is important, but I think that at 48000 samples per second this would roll over after about 1 day (2^32 / (48000 * 60 * 60 * 24)). Probably longer than most AudioContexts survive, but not impossible to see. We may want to do uint64_t instead.

    Alvin Ji

    Thanks for bringing attention to this. Currently from what we are planning, we will reset `total_process_frames_` to `0` in `AddProcessDuration` after every `kReportingInterval` calls. (currently set as 1000).
    Local test shows that `total_process_frames_` usually reach `128000` (or less). (Because the render quantum is now always be 128). I assume this may change once the configurable render quantum feature is landed. And possibly the `total_process_frames_` can reach `512000` (if support up to 512 render quantum) after 1000 `Process` calls. In that case `uint32_t` should still be sufficient to hold the max `total_process_frames_`.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Wilson
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I198c14ac7de3ec7f4a1f7d4b52a817a881a4af86
    Gerrit-Change-Number: 6641781
    Gerrit-PatchSet: 3
    Gerrit-Owner: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Michael Wilson <mjwi...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Hongchan Choi <hong...@chromium.org>
    Gerrit-Attention: Michael Wilson <mjwi...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 23:17:47 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Wilson (Gerrit)

    unread,
    Jun 17, 2025, 7:25:26 PMJun 17
    to Alvin Ji, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Hongchan Choi, asvitkine...@chromium.org, blink-...@chromium.org
    Attention needed from Alvin Ji

    Michael Wilson added 1 comment

    File third_party/blink/renderer/modules/webaudio/audio_handler.h
    Line 72, Patchset 3 (Latest): uint32_t total_process_frames_ = 0;
    Michael Wilson . resolved

    I'm not sure if this is important, but I think that at 48000 samples per second this would roll over after about 1 day (2^32 / (48000 * 60 * 60 * 24)). Probably longer than most AudioContexts survive, but not impossible to see. We may want to do uint64_t instead.

    Alvin Ji

    Thanks for bringing attention to this. Currently from what we are planning, we will reset `total_process_frames_` to `0` in `AddProcessDuration` after every `kReportingInterval` calls. (currently set as 1000).
    Local test shows that `total_process_frames_` usually reach `128000` (or less). (Because the render quantum is now always be 128). I assume this may change once the configurable render quantum feature is landed. And possibly the `total_process_frames_` can reach `512000` (if support up to 512 render quantum) after 1000 `Process` calls. In that case `uint32_t` should still be sufficient to hold the max `total_process_frames_`.

    Michael Wilson

    Ah yes, you're right. Sorry. LGTM!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alvin Ji
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I198c14ac7de3ec7f4a1f7d4b52a817a881a4af86
    Gerrit-Change-Number: 6641781
    Gerrit-PatchSet: 3
    Gerrit-Owner: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Michael Wilson <mjwi...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Hongchan Choi <hong...@chromium.org>
    Gerrit-Attention: Alvin Ji <alv...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 23:25:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alvin Ji <alv...@chromium.org>
    Comment-In-Reply-To: Michael Wilson <mjwi...@chromium.org>
    satisfied_requirement
    open
    diffy

    Alvin Ji (Gerrit)

    unread,
    Jun 17, 2025, 8:21:11 PMJun 17
    to Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Hongchan Choi, asvitkine...@chromium.org, blink-...@chromium.org

    Alvin Ji voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I198c14ac7de3ec7f4a1f7d4b52a817a881a4af86
    Gerrit-Change-Number: 6641781
    Gerrit-PatchSet: 3
    Gerrit-Owner: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Michael Wilson <mjwi...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Hongchan Choi <hong...@chromium.org>
    Gerrit-Comment-Date: Wed, 18 Jun 2025 00:21:00 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Jun 17, 2025, 8:24:28 PMJun 17
    to Alvin Ji, Chromium Metrics Reviews, chromium...@chromium.org, Hongchan Choi, asvitkine...@chromium.org, blink-...@chromium.org

    Chromium LUCI CQ submitted the change

    Change information

    Commit message:
    WebAudio: Add UMA for AudioHandler Process Time Ratio

    Adds a UMA metric, `WebAudio.AudioNode.ProcessTimeRatio.{NodeTag}`, to
    monitor the performance of AudioHandler subclasses.

    This metric reports the percentage of the allocated time budget used by an
    AudioHandler's Process() method, averaged over 1000 calls. The {Type}
    suffix denotes the specific AudioNode type (e.g., GainNode).

    This data will help identify performance characteristics and potential
    bottlenecks in different audio nodes.
    Change-Id: I198c14ac7de3ec7f4a1f7d4b52a817a881a4af86
    Commit-Queue: Alvin Ji <alv...@chromium.org>
    Reviewed-by: Michael Wilson <mjwi...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1475328}
    Files:
    • M third_party/blink/renderer/modules/webaudio/audio_handler.cc
    • M third_party/blink/renderer/modules/webaudio/audio_handler.h
    • M third_party/blink/renderer/modules/webaudio/panner_handler.cc
    • M tools/metrics/histograms/metadata/web_audio/histograms.xml
    Change size: M
    Delta: 4 files changed, 105 insertions(+), 0 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Michael Wilson
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I198c14ac7de3ec7f4a1f7d4b52a817a881a4af86
    Gerrit-Change-Number: 6641781
    Gerrit-PatchSet: 4
    Gerrit-Owner: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Alvin Ji <alv...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Michael Wilson <mjwi...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages