SmallVector could call constructors only when relevant
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.
Here is the benchmark I am looking at:
wasm-ctor-eval --ctors=__wasm_call_ctors,main --kept-exports=main --ignore-external-input a.out.wasm -o b.out.wasm --mvp-features
The benchmark stresses interpreter performance. That matters for wasm-ctor-eval if you run it on computationally-intensive code. But any speedups there should also help with compile times in general as it will help --precompute too.
It would be great if someone wanted to pick this up. It requires some C++ "magic" that I'm not very familiar with (calling a constructor on existing memory, something like that is needed here I assume).