[PATCH] D27960: Use exact vector capacities to store DWARF line tables
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 19 18:04:22 PST 2016
mehdi_amini added a comment.
In https://reviews.llvm.org/D27960#627263, @sque wrote:
> mehdi_amini asked: "Isn't there a way to `reserve()` appropriately initially?"
>
> Not trivially. Look at the while loop that precedes the new code. It looks through the line table but doesn't know beforehand how many Rows there are.
I saw that, but I was more wondering if there isn't another way in the Dwarf to get the information (I don't know if this number could be encoded somehow separately).
> One possible optimization is to first have a dry-run that counts the number of Rows, reserves memory for them, and then runs through again to create the Rows.
Right, but it depends how fast is it to perform this dry-run, especially compared to cost of a little bit of wasted memory.
I mean the maximum waste here is always < 1 page of memory right?
https://reviews.llvm.org/D27960
More information about the llvm-commits
mailing list