[Lldb-commits] [lldb] r105834 - in /lldb/trunk: include/lldb/Symbol/Symtab.h source/Symbol/Symtab.cpp
Owen Anderson
resistor at mac.com
Wed Jun 16 10:04:03 PDT 2010
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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20100616/d3c7a7f6/attachment.html>
More information about the lldb-commits
mailing list