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

    <tr>
        <th>Summary</th>
        <td>
            [Modules] Importing template-heavy library 3x slower than `#include`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    At https://github.com/mpusz/units/pull/350#discussion_r1126631637 is a table that reveals that compiling the compile-time tests of a template-heavy library's module `mp_units` is 3x slower than using `#include`s.

Factoring out a lightweight module `mp_units.core` from `mp_units`, and changing the test `unit_test` to import that instead (and no other changes), reveals that simply importing `mp_units` results in terribly slow compilation. Below is a table comparing the compile times. This particular test was 5x slower than using `#include`, and 11x slower than using the lightweight module.

Compiled item | `#include` | `mp_units.core` | `mp_units`
--- | --- | --- | ---
`unit_test` | 2 s | 1 s | 11 s
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE-PuzYQ_TTmMgoydoBw4LB_StVKlXrofWVgElwZjDzj3aafvjJJ2t1sVP0ujGzPzJv3HrYhsqcFsRXlsyhfMxN58qH91U_ofvr596z347l9YpiYVxL6SahOqO5keYp9PvhZqG5eI_0tVBcXyyRUt0bnhOp0KYXSo6UhElm_vIWiUFWli0rXYAkMsOkdAk-GIeA7GkeXxeDn1Tq7nIAnvK5wx3ZGYCQm8MdUjfPqDONuQvN-Bmf7YMJZqJpg9mN0CKKS8_p2GauSCVP_BeT8B4YEtECkBCKqNKhdBhdHFJWkXMhXIZ8u384M7EPK85HBgLOniT8wfR_g5IMPqQccg5_vBhDqBcwywjCZ5XRjlwilvJT0lhapmD3YefWBL3rYhRjNCEIdUv3iwfOE4dIISagmtf4iIdl5dedrlyvJz1oEpOiYwC7AGILt3XlT5qq2YeuXHJ4xbX3yKp2acOcMJGcohz8mS7CawHaIzoQLtQ9DUP6I6jd1iuJRdoL7rvwXo14u04xgGWcQ9cs3iNvmN7Pu9lPd1nK3221nD-IV-c64dKiAtljcYgGUja0eG92YDNuiqg-FaupaZ1M7lAeti1420jR9rYvjsK8GVGVjDgej5T6zrZJKSy2ropGN1rlsDtUwluW-rvTxOPZiL3E21uXOvc-5D6fMEkVsq0KpKnOmR0e3yx3alLTr44nEXjpLTP-VsWW3PQO_bdqSKF_hl3__n8e37f5C3SuexeDa_3k6Evg17Nbg_8SBheo2Aukl2Tj8EwAA__-bMIJJ">