# SmallVec

> A Rust vector that keeps a few items on the stack before it allocates

Source: https://talira.ai/catalog/smallvec-8mezw7jq
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / data structures / arrays](https://talira.ai/categories/libraries/data-structures/arrays), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: MIT OR Apache-2.0[^3]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Backed by: [Servo Project](https://talira.ai/orgs/servo.md)

SmallVec is an open source Rust library implementing the 'small vector' optimization: a vector type that stores up to a fixed number of items inline on the stack and only moves to the heap when it grows past that. It comes from the Servo project and is used inside the Rust compiler, which uses it in many places to improve performance.

## Links

- Website: https://smallvec.rs/
- GitHub: https://github.com/smallvec/smallvec
- Docs: https://docs.rs/smallvec/

## Problems it solves

- avoid a heap allocation for short vectors in hot Rust code
- a Rust Vec that keeps its first few elements on the stack
- reduce allocations in a performance-sensitive Rust program that builds many small lists

## Features

- stores a small number of items inline on the stack
- spills to the heap only when it grows past its inline capacity
- used inside the Rust compiler

## Limitations

- Version 2 is a pre-release on the main branch; the released 1.x line is maintained on the v1 branch[^1]

## Trust

Overall: 0.64 out of 1.
Signals: maintenance 1.00, adoption 0.65, momentum 0.34, community 0.85, backing 0.30, extensibility 0.00.

- last commit 2 days ago
- 195 commits in the last 90 days
- latest release v1.16.6 12 days ago
- 1.8k GitHub stars
- 135 contributors
- accepts sponsorship (Github, Thanks Dev, Custom)
- backed by Servo Project

## Alternatives

- [arrayvec](https://talira.ai/catalog/arrayvec-j0nm6htp.md): Rust vector and string types with fixed capacity, stored inline

## Sources

[^1]: https://github.com/smallvec/smallvec/blob/main/README.md (checked 28 Nov 2026)
[^2]: https://smallvec.rs/ (checked 28 Nov 2026)
[^3]: https://github.com/smallvec/smallvec/blob/v1/Cargo.toml (checked 28 Nov 2026)
