# gpui: Map \`ztracing\` events to browser \`performance\` APIs on web \(\#62898\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/fe9556a11e9cc9dbc78686041aa524d6932879db)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: fe9556a11e9cc9dbc78686041aa524d6932879db

Requested commit: fe9556a11e9cc9dbc78686041aa524d6932879db

Commit: fe9556a11e9cc9dbc78686041aa524d6932879db

Tree: 3649a5cbec3037019a2e7c72ddf72dd41eb3e508

Author: Cameron Mcloughlin

Committer: GitHub

## Message

```
gpui: Map `ztracing` events to browser `performance` APIs on web (#62898)

Makes `ztracing` spans work on the web, by mapping them to browser
`performance` APIs.

Since calling into JS from wasm has fairly high overhead, we instead
have a dedicated reporter task that threads send timing information to.

This approach significantly decreases the performance overhead of the
span-capturing thread (which is usually the performance sensitive one),
at the expense of:
- erasing thread information for spans in the browser devtools
- potentially dropping events if the bounded queue becomes full

The first issue can be mitigated by some slightly more sophisticated
capturing, along with a fixup script, which will come in a later PR

---

Release Notes:

- N/A or Added/Fixed/Improved ...
```

## Parents

- [1e9f1ef4d1fd7bce5140c268a78e3ccc67ba1ebc](https://git.cafe/gitcafe/zed/commit/1e9f1ef4d1fd7bce5140c268a78e3ccc67ba1ebc?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/fe9556a11e9cc9dbc78686041aa524d6932879db?format=markdown)
