GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — perf_hooks: make nodeTiming a first-class object by mmomtchev · Pull Request #35977 · nodejs/node

Conversation

@mmomtchev

@mmomtchev mmomtchev commented Nov 5, 2020

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@mmomtchev
perf_hooks: make nodeTiming a first-class object
e0b8f00
Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Fixes: nodejs#35936
@nodejs-github-bot nodejs-github-bot added the perf_hooks Issues and PRs related to the perf_hooks module and performance measurement APIs. label Nov 5, 2020
@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 5, 2020
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 5, 2020
@nodejs-github-bot

nodejs-github-bot commented Nov 5, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/34086/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 reviewed Nov 5, 2020
View reviewed changes
Comment thread test/parallel/test-performance-eventlooputil.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mmomtchev
perf-hooks: Make nodeTiming a first-class object
7d64d79
Improve readability as per @aduh95 suggestion

Refs: nodejs#35977
addaleax
addaleax approved these changes Nov 6, 2020
View reviewed changes
addaleax
addaleax reviewed Nov 6, 2020
View reviewed changes
Comment thread lib/perf_hooks.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mmomtchev
perf_hooks: make nodeTiming a first-class object
170242b
Transform the static values to plain properties
(@addaleax review)

Refs: nodejs#35977
@addaleax

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mmomtchev
perf_hooks: make nodeTiming a first-class object
166f6b3
Render all properties configurable
(@addaleax review)

nodejs#35977
jasnell
jasnell reviewed Nov 6, 2020
View reviewed changes
Comment thread lib/perf_hooks.js Outdated
},

idleTime: {
...PerformanceNodeTimingProps,

@jasnell jasnell Nov 6, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mmomtchev mmomtchev Nov 6, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mmomtchev mmomtchev Nov 6, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yeah, this is ECMA specified in fact

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jasnell
jasnell approved these changes Nov 6, 2020
View reviewed changes
@mmomtchev
perf_hooks: make nodeTiming a first-class object
778f60b
Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Refs: nodejs#35977
Trott
Trott approved these changes Nov 7, 2020
View reviewed changes
@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 7, 2020
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 7, 2020
@nodejs-github-bot

nodejs-github-bot commented Nov 7, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/34173/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Nov 8, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/34204/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 11, 2020
@aduh95

aduh95 commented Nov 14, 2020

Copy link
Copy Markdown
Contributor

Landed in feff385

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 closed this Nov 14, 2020
aduh95 pushed a commit that referenced this pull request Nov 14, 2020
@mmomtchev @aduh95
perf_hooks: make nodeTiming a first-class object
feff385
Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Fixes: #35936

PR-URL: #35977
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@spazmodius

spazmodius commented Nov 15, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mmomtchev

mmomtchev commented Nov 16, 2020

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

codebytere pushed a commit that referenced this pull request Nov 22, 2020
@mmomtchev @codebytere
perf_hooks: make nodeTiming a first-class object
ed8af3a
Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Fixes: #35936

PR-URL: #35977
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@codebytere codebytere mentioned this pull request Nov 22, 2020
v15.3.0 proposal #36232
Merged
targos pushed a commit that referenced this pull request May 1, 2021
@mmomtchev @targos
perf_hooks: make nodeTiming a first-class object
395b9a6
Render all properties of nodeTiming enumerable
so JSON.stringify and Object.keys can access them

Fixes: #35936

PR-URL: #35977
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
v14.17.0 proposal #38507
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax approved these changes
@aduh95 aduh95 aduh95 left review comments
@jasnell jasnell jasnell approved these changes
@Trott Trott Trott approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. perf_hooks Issues and PRs related to the perf_hooks module and performance measurement APIs.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

PerformanceEntry toJSON()

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@mmomtchev @nodejs-github-bot @addaleax @aduh95 @spazmodius @jasnell @Trott
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.