Performance measurement design for v6
- Dominant language
- JavaScript
- Stars
- 6.8k
- Forks
- 573
- PR merge metrics
- No merged PRs in 30d
Description
Currently sitting on the third iteration of choo's performance API. The first is live, the second is in the b6 branch. Here's what I was thinking what it should look like instead:

## Hurdles
Currently it's not possible to have multiple listeners, and the way we're handling events is specific to choo. Furthermore we're not logging network requests and sending all trace events through the message bus. All of which leads to messy code, which is not great.
The hardest part of this is assigning unique IDs to both the `performanceEntry` measurements and `nanobus` events. We cannot provide metadata on the measurements themselves, so we'd need to come up with a way to insert a shared token into the name. For the `nanobus` events we'd need to attach the same token as an argument so that the two events can be merged in consuming modules.
## Future
This would also allow us to log [Time To First Meaningful Paint](https://github.com/WICG/paint-timing), [long tasks](https://w3c.github.io/longtasks/) and other events in the near future as they're added into the browser. This approach can also be adapted for other frameworks, both in architecture, but also through module reuse.
## See Also
- https://github.com/WICG/paint-timing
- https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver
- https://w3c.github.io/longtasks/
Contributor guide
Assessment
This issue has not been assessed yet.