Skip to content

Conversation

@legendecas
Copy link
Member

@legendecaslegendecas commented Aug 12, 2022

Add WebPerf API performance.setResourceTimingBufferSize and event
'resourcetimingbufferfull' support.

The resource timing entries are added to the global performance timeline buffer automatically when using fetch. If users are not proactively cleaning these events, it can grow without limit. Apply the https://www.w3.org/TR/timing-entrytypes-registry/ default resource timing buffer max size so that the buffer can be limited to not grow indefinitely.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/startup

@nodejs-github-botnodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Aug 12, 2022
@legendecaslegendecasforce-pushed the resource-timing-buffer-limit branch 2 times, most recently from 601bfad to 2579888CompareAugust 12, 2022 06:41
@legendecas
Copy link
MemberAuthor

@nodejs/diagnostics would you mind taking a look at this PR? thank you!

*/
functionbufferResourceTiming(entry){
if(resourceTimingBuffer.length>=resourceTimingBufferSizeLimit){
dispatchBufferFull('resourcetimingbufferfull');
Copy link
Member

Choose a reason for hiding this comment

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

Not too familiar with the spec, but is this timing expected? Seems to me like it makes more sense for the event to dispatch immediately after reaching capacity so the buffer can be consumed before the next event is received, not at the point the next event is received and discarding the event without having any chance to react before it is discarded. 🤔

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yeah, seems like this is a mismatch with the spec. I'll check again on the steps with the spec conformance. Thanks for pointing this out!

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@legendecaslegendecas marked this pull request as draft August 14, 2022 16:12
@legendecaslegendecasforce-pushed the resource-timing-buffer-limit branch from 2579888 to 6ef3a93CompareAugust 15, 2022 08:25
Add WebPerf API `performance.setResourceTimingBufferSize` and event `'resourcetimingbufferfull'` support. The resource timing entries are added to the global performance timeline buffer automatically when using fetch. If users are not proactively cleaning these events, it can grow without limit. Apply the https://www.w3.org/TR/timing-entrytypes-registry/ default resource timing buffer max size so that the buffer can be limited to not grow indefinitely.
@legendecaslegendecasforce-pushed the resource-timing-buffer-limit branch from 6ef3a93 to e5c6de0CompareAugust 15, 2022 08:30
@legendecaslegendecas marked this pull request as ready for review August 15, 2022 08:32
@legendecaslegendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 15, 2022
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 15, 2022
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Aug 15, 2022

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@RafaelGSSRafaelGSS left a comment

Choose a reason for hiding this comment

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

LGTM (just a documentation suggestion).

@legendecaslegendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2022
@legendecas
Copy link
MemberAuthor

@Qard would you mind taking a look at this again? thank you.

@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2022
@nodejs-github-bot
Copy link
Collaborator

legendecas added a commit that referenced this pull request Aug 21, 2022
Add WebPerf API `performance.setResourceTimingBufferSize` and event `'resourcetimingbufferfull'` support. The resource timing entries are added to the global performance timeline buffer automatically when using fetch. If users are not proactively cleaning these events, it can grow without limit. Apply the https://www.w3.org/TR/timing-entrytypes-registry/ default resource timing buffer max size so that the buffer can be limited to not grow indefinitely. PR-URL: #44220 Reviewed-By: Rafael Gonzaga <[email protected]>
@legendecas
Copy link
MemberAuthor

Landed in 798a6ed

@legendecaslegendecas deleted the resource-timing-buffer-limit branch August 21, 2022 02:44
ruyadorno pushed a commit that referenced this pull request Aug 23, 2022
Add WebPerf API `performance.setResourceTimingBufferSize` and event `'resourcetimingbufferfull'` support. The resource timing entries are added to the global performance timeline buffer automatically when using fetch. If users are not proactively cleaning these events, it can grow without limit. Apply the https://www.w3.org/TR/timing-entrytypes-registry/ default resource timing buffer max size so that the buffer can be limited to not grow indefinitely. PR-URL: #44220 Reviewed-By: Rafael Gonzaga <[email protected]>
@ruyadornoruyadorno mentioned this pull request Aug 23, 2022
Fyko pushed a commit to Fyko/node that referenced this pull request Sep 15, 2022
Add WebPerf API `performance.setResourceTimingBufferSize` and event `'resourcetimingbufferfull'` support. The resource timing entries are added to the global performance timeline buffer automatically when using fetch. If users are not proactively cleaning these events, it can grow without limit. Apply the https://www.w3.org/TR/timing-entrytypes-registry/ default resource timing buffer max size so that the buffer can be limited to not grow indefinitely. PR-URL: nodejs#44220 Reviewed-By: Rafael Gonzaga <[email protected]>
@juanarbol
Copy link
Member

This depends on #40532; marked as "dont-land-on-v16.x"

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@legendecas@nodejs-github-bot@juanarbol@Qard@RafaelGSS