-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add a standard track/category field to the spec #109
Comments
Regarding
In Chromium:
(We may also want to change the default hash strategy to merge more things...) Regarding the concept of optional slow/heavy categories:
|
If you mean Perfetto (trace-viewer too?) yes but not tools like DevTools, the primary frontend for
That would be great. Suggesting a By glancing over at the Perfetto SDK/API, the one feature we would want would be a way to name the track. But that's not essential. |
Fair enough! I think that becomes a distinct feature request for the DevTools product.
+1
I know that capability is supported by Perfetto UI, but I guess it isn't "exposed"? |
Jumping in a little late to the conversation but folks might find this interesting. This is an experimental API we recently made available in Chrome DevTools for extending the Performance panel. It basically fulfills the request for customizing the track User Timings appear within in the timeline: https://bit.ly/rpp-e11y. It relies on the Extension data is expected to be contained under const measureOptions = {
// ...
detail: {
devtools: {
metadata: {
dataType:"track-entry",
extensionName: 'React extension',
},
color: 'primary',
// Track the entry will be displayed in
track: 'React Profiler',
}
},
};
performance.measure( "A measurement", measureOptions); The API is experimental because we are still looking for feedback from the ecosystem to launch something that's valuable, any thoughts would be appreciated! |
That sounds promising. I'll give it a shot in the next 2 weeks and will share some feedback. |
Thank you so much for taking the time to test the API and come back with such detailed feedback!
One way we thought about avoiding overhead in hot paths was by calling the performance.measure API with the measurements after the fact (since it can be tricky to ensure the call to the API is quick) . Say for example measurements are taken efficiently inside React component rendering, but the calls to the API are added at the end of the recording with their original timestamps, which UserTimings L3 allows to do. We are still figuring out what's the most ergonomic and maintainable way to achieve this, especially because the calls to the API might happen after trace events stop being buffered when the recording stops, but it's technically possible. How does this sound to you?
That's a good point and I agree. Will make sure we consider this.
This is something we have been thinking of but aren't sure what shape will be the best for it. We are waiting to get more feedback of possible use cases to have a better idea of this, but I think it isn't a blocker since it could be added progressively .
To make sure I'm following, would this work as a "filter" to allow the developer to select what will be recorded from an extension? If so, that could be pretty interesting. Will investigate if this is also beneficial for other potential early adopters.
That's also a fair point. Will also make sure we consider moving extension tracks closer to timings and likely above the main thread. Also note that you can customize the track order in the Performance panel (right click on the track name -> configure tracks)
Sounds good! I appreciate that. I'll definitely set up something if the conversation extends and needs more space! |
That moves a lot of complexity on to user code, regresses app size to implement a buffering mechanism. It would be much better for UserTimings to buffer itself if it needs to defer something costly. Web binding is cheap enough on all platform. So it's really just about not having too much redundant data in the object, or being able to easily reuse references between calls.
That's the other problem. There's no way to observe that from web APIs currently. There's no 'flush your performance entries now' API. And as long as we can solve the problem above, I think we should continue to punt on adding one.
Yes exactly. It's common to want to select which 'categories' you'll be logging and paying for the cost for. |
After looking into the options to natively work around the performance overhead of the We've added an exploration for this in the whatwgh repo: whatwg/console#140 The main disadvantage of this approach is the disregard for the existing adoption of user timings in the ecosystem, since people are using it for adding stuff to the performance tool but also to power telemetry / logs / etc. An alternative would be to enable |
I agree. In React Native's implementation this is adding significant overhead. This is being optimized in facebook/react-native#45122. But I agree that fundamentally the semantics of the API are going to get in the way here. Personally I don't feel strongly if it should go under either Ultimately I think either approach has pros and cons. I think having cross vendor alignment here is really the most important. I would personally support either variant. If we go with |
I touched on this need in this discussion many years ago: #68 (comment) .
Frankly I've ran into this many times. You can see some screenshots in that discussion for how heavily user timings are used at Meta on web. More recently I'm looking at a tooling integration where this would be useful again. React-native already support user-timings but I'd like to forward it to the system's Perfetto on certain platforms and builds. Tracks are an important feature of Perfetto because it organizes the events in the Perfetto frontend.
Ideally I'd like to see the following happen here:
mark
andmeasure
. We document the expectation that it helps categories events into tracks in the UI to organize them together. This would all be non-normative expectations of downstream tools of course.The text was updated successfully, but these errors were encountered: