# Use \`Vec\` for \`KeyContext\` instead of \`SmallVec\` \(\#24916\) · gitcafe/zed

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

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

Visibility: public

Requested revision: aa4c438f830e64f9427b28e805fae06f86f6f330

Requested commit: aa4c438f830e64f9427b28e805fae06f86f6f330

Commit: aa4c438f830e64f9427b28e805fae06f86f6f330

Tree: ba128d00dc24792309e8e848b417e31059e25fbb

Author: Michael Sloan

Committer: GitHub

## Message

```
Use `Vec` for `KeyContext` instead of `SmallVec` (#24916)

In Zed the key context almost always has more than 1 entry, so use of
`SmallVec` is just adding overhead.

In Zed while using the editor this typically has more than 8 entries.
Since `ContextEntry` is 48 bytes, if this were made to be a
`SmallVec<[ContextEntry; 10]>` then it would use 480 bytes on the stack,
which to me seems like a lot to be copying. So, instead opting to just
use `Vec`

Release Notes:

- N/A
```

## Parents

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

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