[PATCH] MCObjectSymbolizer

Stephen Checkoway s at pahtak.org
Mon Oct 14 18:28:42 PDT 2013


On Oct 14, 2013, at 9:23 PM, Chandler Carruth <chandlerc at google.com> wrote:

> On Mon, Oct 14, 2013 at 3:49 PM, Stephen Checkoway <s at pahtak.org> wrote:
> 
>> MCObjectSymbolizer currently iterates through each symbol every time it is
>> asked to tryAddingSymbolicOperand. With many symbols, this takes a very
>> long time.
>> 
>> The attached patch iterates through the symbols the first time this is
>> needed and puts them in a sorted vector. Subsequent lookups use
>> std::upper_bound() to find the symbol in log(n) time.
>> 
> 
> While this is great, this really sounds like it should be putting things
> into a hash table based datastructure. DenseMap most likely. That will
> likely give you yet more performance.

Most of the time, it's not looking up the symbol itself but an address past it. That means we need to find the symbol with the largest address that is at most the query address. Hash table won't work for that.

-- 
Stephen Checkoway







More information about the llvm-commits mailing list