syntax: replace OptVec with plain Vec.#12675
Conversation
The new vector representation has no allocations when empty, so OptVec is now useless overhead.
|
@thestinger raised a good point on IRC: using a plain Currently IRFY isn't showing the memory use of the |
|
This is nice. (Eventually all |
|
cc me |
|
r=me (looks like bors got confused) |
|
I cancelled the build, pending memory benchmarks (#12675 (comment)). |
There is a broader revision (that does this across the board) pending in rust-lang#12675, but that is awaiting the arrival of more data (to decide whether to keep OptVec alive by using a non-Vec internally). For this code, the representation of lifetime lists needs to be the same in both ScopeChain and in the ast and ty structures. So it seemed cleanest to just use `vec_ng::Vec`, now that it has a cheaper empty representation than the current `vec` code.
There is a broader revision (that does this across the board) pending in rust-lang#12675, but that is awaiting the arrival of more data (to decide whether to keep OptVec alive by using a non-Vec internally). For this code, the representation of lifetime lists needs to be the same in both ScopeChain and in the ast and ty structures. So it seemed cleanest to just use `vec_ng::Vec`, now that it has a cheaper empty representation than the current `vec` code.
|
Mem benches have landed: http://huonw.github.io/isrustfastyet/mem/#910012a,0017056 So the doubly-fat-pointer Vec change made the compiler use 200 MB more memory when compiling librustc. I'll revive and reopen in a few days (maybe tomorrow). |
syntax: replace OptVec with plain Vec.
The new vector representation has no allocations when empty, so OptVec
is now useless overhead.