Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User timing buffer size #92

Closed
legendecas opened this issue May 17, 2022 · 2 comments
Closed

User timing buffer size #92

legendecas opened this issue May 17, 2022 · 2 comments

Comments

@legendecas
Copy link
Member

legendecas commented May 17, 2022

While investigating the use cases of #86, I found that in cases like using a third-party library, the library can unconditionally create entries, and the user may not be aware of this behavior, and the global user-timing buffer may be overflown. In those cases, we may need another tool to improve the memory management of user timing APIs.

I'm thinking that a global limit on the user-timing buffer size, Performance.setUserTimingBufferSize, can help in the condition that users are not proactively clearing the entries and prevent the buffer to grow oversize, just like Performance.setResourceTimingBufferSize. When the buffer size grows over the limit, people can still observe the entries with the PerformanceObserver.

This addition is not overlapping with #86. The buffer size limit could help in conditions when the measure producer (like third-party libraries) is not observing the measurements and thus not clearing the entries proactively. While #86 is for end-users who are producing entries and clearing the entries by themselves.

@yoavweiss
Copy link
Contributor

We discussed this at the WebPerfWG call yesterday.
It seems like the buffer's limitation is mostly a NodeJS use case, to avoid libraries from accumulating entries without clearing them for long lived server applications.

The conclusion was that namespaces may reduce the issue by making it easier for libraries to collect their entries, and that Node can consider adding some limitation to the buffer as an intervention on their user's behalf.

@legendecas
Copy link
Member Author

Thank you for the suggestions! I believe an implementation-defined limit to the buffer size can be a good approach to the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants