# gpui: Record debug selectors only in debug builds \(\#65056\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 506beb34de3f433707b7ebe8d8ad2d80f856af6c

Requested commit: 506beb34de3f433707b7ebe8d8ad2d80f856af6c

Commit: 506beb34de3f433707b7ebe8d8ad2d80f856af6c

Tree: 1edc3003ee9e8bcf141b19da7c25cf1c50d49d25

Author: Conrad Irwin

Committer: GitHub

## Message

```
gpui: Record debug selectors only in debug builds (#65056)

Since #65043, `gpui/test-support` is safe to enable in every build, and
downstream projects (Delta) do so to avoid compiling GPUI twice. One
exception remained: with the feature on, `debug_selector` allocates its
`String` on every element construction, and paint copies it into the
frame's debug-bounds map every frame, even in release builds. Its docs
already promised it was a no-op in release.

Selectors are now recorded only in GPUI's own tests and in debug builds
with `test-support`. `VisualTestContext::debug_bounds` returns `None` in
optimized test builds; Zed doesn't run tests that way.

Release Notes:

- [GPUI] Fixed `debug_selector` allocating and recording bounds every
frame in release builds with `test-support` enabled
```

## Parents

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

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