-
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
Allow performance.measure() to specify optional color parameter, to be used by perf visualizations in devtools #69
Comments
I know it somehow doesn't feel right to pass the color param to the API which is about measuring things, but I don't know what could be the alternatives. Anyway, having the feature in some form would be pretty interesting IMO. |
Hmm I don't think that JS is the correct place to be determining the colors of the marks and measures. To me it seems like this should be a feature request for Chrome DevTools, or any other developer tooling being used to debug. They could potentially add regex filters for entries by name to be colored in a specified color. |
FWIW it's possible to style I was not sure what's the best place to ask this, whether in spec or in Chrome bug tracker. The thing is, if it's not in spec, it's unlikely any browser will ship it, as this would collide with potential future extensions of the spec, hence rather risky. |
This is one way to do that, but I find it rather limiting. It's not really portable/scalable (I check on different machine/different version of Chrome etc. and this info is gone); having static filtering only is also limiting; would probably require renaming the labels and/or having complex set of rules in devtools. One could also imagine for example taking a runtime decision which color to mark something with (for example, different color depending if a task took more time than the budget is) - similar to #25. In this case, regex in devtools does not fit that use case (unless the developer outputs a different label for such measures, to fit the appropriate regex) |
Can't you supply some JSON data on |
I like the idea of "sub-timelines" as an alternative/complement to colors. I opened a Chrome DevTools ticket to gather opinions of DevTools folks: https://crbug.com/1057078 |
I think these are great ideas. It's still not clear to me what's a good way to 'standardize' a solution here, but let's keep this open and eventually this should we discussed in the Web Perf WG. Thanks for filing the Chromium bug, I'll follow up with Chrome DevTools but I know they're pretty swamped in work right now so not sure when this work would occur. |
I don't think this belongs in the spec. The example where this was provided in the console spec makes sense because the console is the display of the logging data. Similarly, chrome dev tools would be the display of this data so makes most sense to be provided in chrome (and other browsers). |
@mathiasbynens - This seems like a devtools feature request. |
I agree this doesn't belong in the spec; it's controlling an implementation detail. Thanks for filing the DevTools feature request. Let's continue the discussion there? |
Ok, closing this then, the discussion can continue in the crbug. |
There are 2 main uses for
performance.measure()
AFAICT:performance.getEntries*()
methodsThe visualization part is very powerful for analyzing performance. For that use case, it could be interesting if it was possible to specify the color in which the bars are to be displayed. Right now, Chrome takes random shades of yellow/orange for each bar.
Example usages:
Right now for example in my app, while waiting for important things to be fetched asynchronously, non-important work is happening as the main thread is available. When I look at the Chrome perf panel visualization, it's not immediately obvious where important things are happening vs less important things. I need to zoom in and read the labels to understand that.
The text was updated successfully, but these errors were encountered: