<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - [Regression] Quadratic module build time due to Preprocessor::LeaveSubmodule"
   href="https://llvm.org/bugs/show_bug.cgi?id=24667">24667</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Regression] Quadratic module build time due to Preprocessor::LeaveSubmodule
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Modules
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>chisophugis@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14809" name="attach_14809" title="Test script exhibiting quadratic module build time with ToT.">attachment 14809</a> <a href="attachment.cgi?id=14809&action=edit" title="Test script exhibiting quadratic module build time with ToT.">[details]</a></span>
Test script exhibiting quadratic module build time with ToT.

Consider:

module foo {
  header "foo1.h"
  header "foo2.h"
  ......
}

foo<n>.h:
#pragma once
#define FOO_<n>

Preprocessor::LeaveSubmodule does O(# macros in submodule) work every time it
leaves a header. This results in quadratic build times, a regression from clang
3.6

The attached script shows the following times for different values of N with
ToT:
(N)     (time)
128     0.0208690166473
256     0.0294139385223
512     0.0603349208832
1024    0.158221006393
2048    0.521872997284
4096    1.93269181252
8192    7.92222499847

Same thing but for clang 3.6:
128     0.0171859264374
256     0.0209867954254
512     0.0306701660156
1024    0.0452530384064
2048    0.0781750679016
4096    0.141057014465
8192    0.270556926727</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>