[Lldb-commits] [PATCH] D49612: Use LLVM's new ItaniumPartialDemangler in LLDB

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 25 01:42:58 PDT 2018


sgraenitz marked an inline comment as done.
sgraenitz added a comment.

I did a little investigation of the performance impact of not reusing the IPD. For this I used the unit test `PartialDemangleTest.TestNameChopping`, where I added an outer loop:

  TEST(PartialDemangleTest, TestNameChopping) {
    ...
    llvm::ItaniumPartialDemangler IPD;
    for (int i = 0; i < (1 << 20); ++i) { // 1M repetitions
      for (ChoppedName &N : NamesToTest) {
        EXPECT_FALSE(IPD.partialDemangle(N.Mangled));
        EXPECT_TRUE(IPD.isFunction());
        EXPECT_FALSE(IPD.isData());
        ...

Then I compared runtimes when having IPD outside vs. inside the two for loops. Over a series of test runs, the average inside-the-loops overhead is around 10% here. Just for interest I then raised the initial buffer size from 4k to 1M. This obviously has a much bigger impact on the runtimes:

          IPD outside     IPD inside      IPD inside (1MB)
  real	0m10.626s       0m11.769s       0m32.064s
  user	0m10.474s       0m11.601s       0m27.526s
  sys	0m0.082s        0m0.091s        0m4.394s

I think today's heap implementations are pretty good in allocating 4k chunks of memory. Nevertheless, in the next step we should try and avoid this overhead. This may require conceptual changes though. I send a comprehensive proposal to the dev list for discussion.


https://reviews.llvm.org/D49612





More information about the lldb-commits mailing list