w3c / user-timing

User Timing
https://w3c.github.io/user-timing/
Other
25 stars 24 forks source link

Add `mark_feature_usage` as a recommended mark name #105

Closed anniesullie closed 10 months ago

anniesullie commented 11 months ago

As discussed in the web performance working group meeting on October 12, it would be good to add mark_use_counter as a "Recommended Mark Name" to allow a convention for noting the use of features which might affect performance in a way that enables tooling and analysis (slides, notes).

Proposed syntax:

performance.mark('mark_use_counter',
    {'detail': {
        'feature': 'NgOptimizedImage',
        'framework': 'Angular',
        // Feature-specific data
        // Future use cases may expand this, i.e.
        // 'version': '10.33.56'
        }
    }
);

In this syntax, feature is the name of the feature that might affect performance. There are some examples here, like the nuxtjs/google-fonts module which automatically self hosts fonts and supports inlining to avoid server round trips, or the next/image component which uses browser lazy loading and fetchpriority to optimize image prioritzation.

And framework is the framework or platform the feature is relevant to. In the example above, nuxtjs is the framework that uses nuxtjs/google-fonts, but the framework could be a CMS, a large commerce platform, or any other entity with multiple features.

Since marks include timings, guidance on timing of the mark should also be included.

anniesullie commented 10 months ago

Reopening for #108