-
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
Enable namespace-based subscription for mark / measure #24
Comments
I like the idea. Were you envisioning a whole new set of API arguments to accept the optional namespace, or something "built-in" to the mark name? i.e.
Gets a little clunkier with It seems like the PerformanceTimeline and PerformanceObserver interfaces would still need optional UserTiming-specific arguments to know about namespaces:
|
We (React) are definitely interested in this. I'm thinking of always emitting measurements for components by default in DEV, but then this would spam the DevTools for people who aren't profiling React at the moment. Unfortunately, any prefix makes the tree completely useless in Chrome because you have to zoom in to read any individual item. For now, I'm thinking of using emoji for React measurements: This way people using |
On Firefox OS, we had to do some similar hackery to be able to filter performance entries by application: performance.mark('appLaunch@clock.gaiamobile.org'); But eventually this would come down to wanting to filter on any kind of custom data. Maybe custom data should be resurrected and then the filter done in the observer? new PerformanceObserver(list => {
list
.filter(measure => measure.data.namespace === 'react')
.map(measure => doWhatever());
).observe({entryTypes: ['measure']}); |
I believe w3c/charter-webperf#28 will solve all of the above pretty cleanly. Roughly...
If that sounds reasonable, I propose we close this and move the discussion to the other thread. |
I like w3c/charter-webperf#28 a lot. The main downside I see to that approach is discoverability. For example, today, if RUM wants to collect all UserTimings on the page, from every library producing any marks and measures, it's a straightforward If we migrated everyone to creating custom PerformanceEntry objects, RUM wouldn't know whether those "custom" PerformanEntry types should be collected as well. Browser dev tools wouldn't necessarily know if they're appropriate to put in their dev tools timelines, etc. Moving people to custom PerformanceEntries kinda goes against one of the strong-points of UserTiming, which is when we get everyone producing UserTiming marks/measures, more third parties will be encouraged to consume/display/measure/aggregate them. Unless... those custom PerformanceEntries are all subclasses of PerformanceMark/Measure? |
One of these has to give.. Right now we're on a blacklist model, which is what motivated this thread. By moving to a whitelist model (you need to know what you want), you reduce the noise, but trade it off against missing what you don't know. FWIW, I think well known lists would emerge pretty naturally -- e.g. React team can declare their names, which everyone can subscribe to, and so on. |
Maybe with w3c/charter-webperf#28 we could have a way of enumerating all custom PerformanceEntry types? That way if RUM wants to have knowledge of all things, it looks at the registry and queries each individually? |
Yeah, that's a plausible solution. However, that's also time dependent solution.. someone has to emit the record before we know about it, and there are no guarantees that they will do so ever again. Let's note it on that thread and move the discussion there. Any objections to closing this one? |
None from me |
None from me either. |
👍 Let's continue discussion in w3c/charter-webperf#28. |
(feel free to dup if this issue has been discussed previously)
A lot of different parties -- such as Ads, frameworks etc -- are now adding mark & measure to timeline. It is spammy to receive all the marks added by everyone on the timeline.
Currently developers have to discover and maintain a list of name prefixes to ignore.
(for instance Google Ads caused some ripples with adding "goog" prefixed marks affecting large number of sites)
Instead, it would be great if marks & measures could be namespace'd and developers could subscribe to specific namespaces.
@pmeenan @paulirish @nicjansma
The text was updated successfully, but these errors were encountered: