FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

perf_hooks: make nodeTiming a first-class object by mmomtchev · Pull Request #35977 · nodejs/node · GitHub

/ node Public

perf_hooks: make nodeTiming a first-class object - #35977

Closed
mmomtchev wants to merge 5 commits into
nodejs:masterfrom
mmomtchev:perf-node-enumerable
Closed

perf_hooks: make nodeTiming a first-class object#35977
mmomtchev wants to merge 5 commits into
nodejs:masterfrom
mmomtchev:perf-node-enumerable

Conversation

Copy link
Copy Markdown
Contributor

Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Fixes: #35936

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Fixes: nodejs#35936
nodejs-github-bot added the perf_hooks Issues and PRs related to the implementation of the Performance Timing API. label Nov 5, 2020
Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 5, 2020
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 5, 2020

Copy link
Copy Markdown
Collaborator

Comment thread lib/perf_hooks.js
Transform the static values to plain properties
(@addaleax review)

Refs: nodejs#35977

addaleax commented Nov 6, 2020

Copy link
Copy Markdown
Member

Actually, I’d make all of these configurable … it can be nice to be able to override them for testing purposes if that’s ever necessary

Comment thread lib/perf_hooks.js Outdated
},

idleTime: {
...PerformanceNodeTimingProps,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Non-blocking: I would just include the properties directly here (rather than use the repeated `...PerformanceNodeTimingProps) even if they're going to be duplicated just to save an unnecessary performance cost.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hmm, do you think V8 keeps a reference to the initializing object when using the spread operator?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, this is ECMA specified in fact

Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Refs: nodejs#35977
Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2020
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2020

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

aduh95 added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Nov 11, 2020

aduh95 commented Nov 14, 2020

Copy link
Copy Markdown
Contributor

Landed in feff385

aduh95 closed this Nov 14, 2020
aduh95 pushed a commit that referenced this pull request Nov 14, 2020
Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Fixes: #35936

PR-URL: #35977
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>

spazmodius commented Nov 15, 2020
edited
Loading

Copy link
Copy Markdown

Does this obviate the need for [util.inspect.custom]()?
See https://github.com/mmomtchev/node/blob/778f60b7626f0a715ae4071cdb944165251028e9/lib/perf_hooks.js#L257

Copy link
Copy Markdown
Contributor Author

Does this obviate the need for [util.inspect.custom]()?
See https://github.com/mmomtchev/node/blob/778f60b7626f0a715ae4071cdb944165251028e9/lib/perf_hooks.js#L257

No, you still need it to get a pretty console output, you see [Getter] instead of the actual value without it

codebytere pushed a commit that referenced this pull request Nov 22, 2020
Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Fixes: #35936

PR-URL: #35977
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere mentioned this pull request Nov 22, 2020
targos pushed a commit that referenced this pull request May 1, 2021
Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Fixes: #35936

PR-URL: #35977
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams mentioned this pull request May 3, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. perf_hooks Issues and PRs related to the implementation of the Performance Timing API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PerformanceEntry toJSON()

7 participants


Back | FazBrowse Home | New Git URL