Use SmallVec instead of Vec
- Dominant language
- Rust
- Stars
- 1.7k
- Forks
- 218
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
### What is wrong?
There are places where we could be using [`SmallVec`](https://docs.rs/smallvec/1.6.1/smallvec/)s to reduce heap allocations.
For example, the function statement `Vec`s being returned in the [lowering pass](https://github.com/ethereum/fe/blob/master/compiler/src/lowering/mappers/functions.rs#L32) will always be pretty small.
We should update any other places where we are using small vectors, but not `SmallVec`.
### How can it be fixed
:keyboard:
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with compiler/src/lowering/mappers/functions.rs, especially the function statement Vecs returned in the lowering pass. Then inspect the compiler for other small vectors that could use SmallVec; done means the applicable cases are updated without changing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100