WebAssembly / WebAssembly/binaryen
SmallVector could call constructors only when relevant
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
The fixed storage there is a std::array which constructs the items immediately. We could instead use a different approach that only calls the constructor when the size actually increases.
This looks like it might be a noticeable speedup as I see profile data in which Literals, a SmallVector of Literal, is fairly high. The Literal constructor is apparently not cheap.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the SmallVector implementation and inspect how its fixed std::array storage constructs elements, then follow the Literals and Literal usage mentioned in the issue. Compare the current behavior with an approach that constructs elements only as the size increases, and verify both correctness and whether the relevant profile improves.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100