# Add VecMap and use it in ProjectGroupBuilder \(\#52596\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 9fe2a602b94908b0a513437d09c418c43e1fedf8

Requested commit: 9fe2a602b94908b0a513437d09c418c43e1fedf8

Commit: 9fe2a602b94908b0a513437d09c418c43e1fedf8

Tree: 6ecd8e3e9423ef8472383f284c7c0db037d1d963

Author: Eric Holk

Committer: GitHub

## Message

```
Add VecMap and use it in ProjectGroupBuilder (#52596)

This adds a collection that has a map-like API but is backed by vectors.
For small collections, this often outperforms a HashMap because you
don't have the overhead of hashing things and everything is guaranteed
to be contiguous in memory.

I hand-rolled one of these in `ProjectGroupBuilder` but this factors it
into its own collection. This implements the API that
`ProjectGroupBuilder` needed, but if this becomes more widely used we
can expand to include more of the `HashMap` API.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
```

## Parents

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

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