aprantl marked an inline comment as done. aprantl added a comment. I don't have any numbers to back up the performance claim. My primary motivation for this patch was to prepare the code for adding extra functionality; the performance gain was only side-effect. One way to measure it would be to open a large project and set a regexp breakpoint on something very common.
================ Comment at: source/Breakpoint/BreakpointResolver.cpp:183 llvm::StringRef log_ident) { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS)); - - while (sc_list.GetSize() > 0) { - SymbolContextList tmp_sc_list; - unsigned current_idx = 0; - SymbolContext sc; - bool first_entry = true; - - FileSpec match_file_spec; - FileSpec match_original_file_spec; - uint32_t closest_line_number = UINT32_MAX; - - // Pull out the first entry, and all the others that match its file spec, - // and stuff them in the tmp list. - while (current_idx < sc_list.GetSize()) { - bool matches; - - sc_list.GetContextAtIndex(current_idx, sc); - if (first_entry) { - match_file_spec = sc.line_entry.file; - match_original_file_spec = sc.line_entry.original_file; - matches = true; - first_entry = false; - } else - matches = ((sc.line_entry.file == match_file_spec) || - (sc.line_entry.original_file == match_original_file_spec)); - - if (matches) { - tmp_sc_list.Append(sc); - sc_list.RemoveContextAtIndex(current_idx); - - // ResolveSymbolContext will always return a number that is >= the line - // number you pass in. So the smaller line number is always better. - if (sc.line_entry.line < closest_line_number) - closest_line_number = sc.line_entry.line; - } else - current_idx++; + llvm::SmallVector<SymbolContext, 16> all_scs; + for (unsigned i = 0; i < sc_list.GetSize(); ++i) ---------------- shafik wrote: > The number `16` and `8` below where do they come from? I just pulled those numbers out of thin air :-) The first one is twice as big as the second one, because there is some filtering happening in between. https://reviews.llvm.org/D51453 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits