<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58141>58141</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp very slow to compile
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++,
            slow-compile
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          arichardson
      </td>
    </tr>
</table>

<pre>
    I am trying to run the libc++ test suite (using a release+assertions clang) with a 120 second timeout per test and this test times out. It takes a very long time to compile (about two minutes): `libcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp`

I am not sure if this is a clang frontend/codegen performance issue or a problem with the way the test is written: Running the compilation command with -ftime-trace=foo.json shows that a bit over 1 minute is spent in the frontend (almost all of that inside InstantiateFunction) and almost one minute in the backend.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1U9tupDAM_Rp4sQZBuCzzwEO7VaW-7g9UIZghbUhQYjqdv18nTNv9gZWiBMfO8fGxGd10G15ArkD-pu0FyIHfLdCCYPSoMvHICwgDQdg1IWSi30OMlODRoAzIATIE9KSdDaCMtJdMnOGqaeGgSpQQUDk7AekV3U6woT8QZbxcdDis6A7AAQW8sCXf2ZLwgf4GxkVq7I_8lFs3bRITOUY8ujpYtd0ZhRNn9QNkXRnZf35m4jli8xFo4n0nbTTpGPg8O79K-v4o5t2qVMP31Su5V1sYp6TBYuMiC7VtjJ2VT1n5cOxJPOuiPB5Bz0dBOlJPUsDsnSW0MbtyE17QRgFSAqv4RQg7gvMcv3k3GlwP5WIHrvKWziQPQ169JoaKFf7ZrU39YvchiIzc4_caZU0YpzlqdiIvFWb10-xc8RY4KCzuyqIvklsAoyZwrDJUdxFjprCh5ZTHIHxVkBQ3q4udMwbcfEBoG_SE8GIDSUtaEj7flYxjEMncHzmL3ykO5FGqdwYuchyqrmv6vukqkU9DPZ3rs8xJk8Hhv3XymK1g3PWfscp3b4aFaAssM7_ndWEt97HgADaM-fg6TtywN1QxcepiTNf2VVPly1DNU9f1Xde2jWhapbq-bicp63KuzvXYYG7kiCYMWcs_mPj51djIxG9WWkRepzupeNs-5XoQpRBVWTZV1XatKNQvMU5zKcp-moXoRNaUuEptikivcP6S-yExHfdLYKfRgcKPk3XQF4uYWDC-3GlxfpBeq0X6iUclT4UNqaq_p8dtaA">