# Introduce \`ZED_MEASUREMENTS=1\` and \`script/histogram\` \(\#4191\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 4312c7d1e613a3be44a8f13d81cdf814e3dc6dec

Requested commit: 4312c7d1e613a3be44a8f13d81cdf814e3dc6dec

Commit: 4312c7d1e613a3be44a8f13d81cdf814e3dc6dec

Tree: 4a44e1c7761f86e82babb8447ef46c854763364e

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Introduce `ZED_MEASUREMENTS=1` and `script/histogram` (#4191)

With this pull request, we're introducing a `ZED_MEASUREMENTS` variable
which is used by the `measure` function to print to stderr how long it
took to execute a given closure. This is used right now to measure frame
time when a new frame is requested. This data can be plotted as a
histogram via `script/histogram`.

Here's a workflow I typically use:

- Run `export ZED_MEASUREMENTS=1`
- Checkout a commit that you want to measure the performance of
- Run zed in release mode and use it for 5-10 seconds
- Copy the printed measurements into a file, say `version-a`
- Checkout another commit that you want to measure the performance of
- Run zed in release mode and use it for 5-10 seconds
- Copy the printed measurements into a file, say `version-b`
- Run `script/histogram version-a version-b` (note that you can supply
however many files you want)

Release Notes:

- N/A
```

## Parents

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

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

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