choojs / choojs/choo

Performance measurement design for v6

Open
#512 1 comment 1 reaction 0 assignees View on GitHub
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:

![img_20170616_135818](https://user-images.githubusercontent.com/2467194/27225867-70148c8a-529c-11e7-839c-6a4b00c3937b.jpg)

## 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.