[Lldb-commits] [lldb] r105834 - in /lldb/trunk: include/lldb/Symbol/Symtab.h source/Symbol/Symtab.cpp
Jim Ingham
jingham at apple.com
Wed Jun 16 10:41:53 PDT 2010
Very cool, thanks!
Jim
On Jun 16, 2010, at 10:22 AM, Owen Anderson wrote:
> Assuming you meant "purge" at the command line, I still measure 0.052s for -Os with std::stable_sort. If there's nothing else you want me to test, I'll go ahead and commit it with that.
>
> --Owen
>
> On Jun 16, 2010, at 10:19 AM, Greg Clayton wrote:
>
>> Great news. Try testing this same stuff after a "purge" (clear the file caches). The "purge" is not a great test, but it gives you a bit of an idea of how things would perform if nothing was in the file cache...
>>
>> If things turn out the same as before, feel free to checkin the std::stable_sort fix.
>>
>> Greg Clayton
>>
>> On Jun 16, 2010, at 10:04 AM, Owen Anderson wrote:
>>
>>> OK, I just performed these measurements on 64-bit 10.6, with both -Os and -O3 builds of lldb. In both cases, std::sort was on the order of 50% slower than qsort_r:
>>>
>>> -Os -O3
>>> std::sort 0.118s 0.103s
>>> qsort_r 0.077s 0.078s
>>>
>>> However, here's the interesting part:
>>>
>>> std::stable_sort 0.051s 0.048s
>>>
>>> So, it looks like the symbol tables are already mostly sorted, and a simple insertion sort is able to "complete" the sort quickly. FWIW, this would also be a good place to apply TimSort or some other heuristic sort.
>>>
>>> --Owen
>>>
>>>
>>> On Jun 16, 2010, at 9:27 AM, Greg Clayton wrote:
>>>
>>>> We start with "Sketch" from the /Developer/Expamples. It loads 91 shared libraries right off the bat, and if you then type:
>>>>
>>>> (lldb) log timers enable
>>>> (lldb) breakpoint set --name main
>>>> (lldb) log timers disable
>>>>
>>>> All of the symbol tables will be pulled in, and it will dump the timing information.
>>>>
>>>> You will first need to add a scoped timer to the top of:
>>>>
>>>> Symtab::SortSymbolIndexesByValue()
>>>>
>>>> The easiest way is:
>>>>
>>>> Timer scoped_timer (__PRETTY_FUNCTION__,__PRETTY_FUNCTION__);
>>>>
>>>> Then you should see an entry in the timer dump for Symtab::SortSymbolIndexesByValue when the "log timers disable" is run with a total time.
>>>>
>>>
>>>
>>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
More information about the lldb-commits
mailing list