<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Microsoft mangling takes forever with large, deeply nested templates"
   href="https://bugs.llvm.org/show_bug.cgi?id=34356">34356</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Microsoft mangling takes forever with large, deeply nested templates
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>george.burgess.iv@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Split from <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - clang is 36.5 times slower than gcc"
   href="show_bug.cgi?id=29160">https://bugs.llvm.org/show_bug.cgi?id=29160</a>, in hopes of making a
more targeted bug.

To reproduce, compile the test-case from said bug with:

$ clang -target i686-windows -fms-compatibility -fmsc-version=1700 tc.cpp
-DCHUNKS=N

(for values of N >= 15).

Looks like, as we approach -DCHUNKS=42, we're building up more and more massive
(>100MB) strings so we can potentially discard them and use a backreference
instead. (In particular, we do this in the `isTemplate()` branch in
MicrosoftCXXNameMangler::mangleUnqualifiedName). Blindly caching these sped up
execution time substantially (DCHUNKS=42 ran in ~5 minutes, instead of 35), but
also made clang use 21GB of RAM. This doesn't seem ideal.

I thought 100MB strings sounded large, but when I asked clang to -ast-dump the
program, I killed it after 2 hours and >200GB of output. So...</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>