This is an archive of the discontinued LLVM Phabricator instance.

Use exact vector capacities to store DWARF line tables
AbandonedPublic

Authored by sque on Dec 17 2016, 3:02 PM.

Details

Reviewers
echristo
Summary

A large binary's DWARF info can contain line tables with thousands of entries. Since dynamically resized vectors don't have exact capacities, there could be a large amount of wasted space. This patch changes the DWARF reader to store the line table rows in vectors with exact capacities.

Diff Detail

Event Timeline

sque updated this revision to Diff 81853.Dec 17 2016, 3:02 PM
sque retitled this revision from to Use exact vector capacities to store DWARF line tables.
sque updated this object.
sque added a reviewer: echristo.

Doesn't vector have "shrink_to_fit()" for this purpose?
Isn't there a way to reserve() appropriately initially?

Also two general issues:

  1. You need to add llvm-commits as a subscriber for the patch *on creation*. So now you should close it and reopen a new one, with llvm-commits (this is because for the archive, we want the mailing list to have a proper thread with the patch from the start).
  1. It is nicer when reviewing patches to have the full context (git diff -U9999, or use arc).
sque abandoned this revision.Dec 19 2016, 4:36 PM