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

    <tr>
        <th>Summary</th>
        <td>
            Quadratic scaling in processing of designated initializers
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ```sh
printf 'x(%d)\n' $(seq 10000) > x10000.h
```
```c
struct S {
#define x(n) int m##n;
#include "x10000.h"
#undef x
} s = {
#define x(n) .m##n = n,
#include "x10000.h"
#undef x
};
```
needs more than a second to compile, and scales quadratically with the number of fields. `perf report` shows 42% in CheckDesignatedInitializer, 34% in CheckStructUnionTypes and 17.5% in FieldDecl::getCanonicalDecl.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUUsuOpDgQ_JrkkmoEyas4cKiu2pL2uOqdDzB2Unja2LRt-jFfPzJd_bjMYSQkSDIcERlpEYK-WuYBmntozpnY4uz8IBZnxaN7zkan3gZoi_cnzFAcV69tnBCoewU6ADUKqIfmZIE6BKqBDoGfsCyKogDqEap_8HWv8nT8k-z7t4TiGKLfZMQHhO4-9ahSPGnLmGRsYtI24gJUAVUWqhtIW2k2xQhEnypE773NKp7wNRXdGQNCdf4ze_5BvcMs0OkvBW6Wvs1nmVXAxXnGOAuLAgNLZxVGh9ItqzYMdEJhFQYpDAd82oTyImopjHnDFx1njDOj3ZaRPboJJ81GhRyhLVb2E3penY_QFhhm9xKwJqAGtcXTzPLxzGm9IrL61-qohdG_2CfJqv4Oe9ij_2G1s_-_rRx2R2WXNzfQJYmeWRqojlAdrxxPwjqbXKa_eaaGSvVVLzIeyq5uqG7Kvs7mQXXtoWxk3dTVKMdD3bVqnERTlNzJuqIu0wMV1BQ1lWVd9k2Vj0xd2_ddWav-QEJCXfAitMmNeV5y56-ZDmHjoazapj1kRoxswn57iSy_4N5N-2nOmR_SobtxuwaoC6NDDF80UUfDw38fee8L0Paaxl29kxxCqtyE6jND1F8hhmzzZphjXEMKhS5Al6uO8zbm0i1AlyR0e92t3v1kGYEuu70AdLn5fx7odwAAAP__CJ4O4Q">