nodejs / nodejs/node

console.timeStamp(...) and performance.mark/measure are missing from the --inspect Performance Timings timeline

未关闭
#47,813 8 条评论 13 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

inspector perf_hooks
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

描述

Version

20

Platform

No response

Subsystem

No response

What steps will reproduce the bug?
console.profile()

console.timeStamp('Start Rendering')
performance.mark("Start rendering")

function createArr() {
  return new Array(10000).join('x')
}

for (var i=0; i< 1000;i++) {
  createArr()
}

performance.mark("Finish rendering")
performance.measure("Rendering", "Start rendering", "Finish rendering")

console.timeStamp('Finish Rendering')
console.profileEnd()
How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?
  1. Per the node docs on console.timeStamp(...) with the --inspect flag enabled, I should be able to see the timestamp indicated on the performance tab.

  2. The User Timings API, performance.mark, and performance.measure show up as "Timings" in the browser's Chrome Dev Tools, but does not show up in node.

What do you see instead?

I don't see any User Timings API calls on the performance timeline.

image

When using the same performance.* methods in the browser I see them show up in the Performance Timeline.

image
Additional information

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用 Node 20 和 --inspect 重现该示例,然后将 Performance Timings 时间线与 issue 中描述的浏览器行为进行比较。跟踪 console.timeStamp、performance.mark 和 performance.measure 如何暴露给 inspector,并验证时间戳、标记和测量结果会出现在 Chrome DevTools 中。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
devtools, performance
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
50/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。