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

    <tr>
        <th>Summary</th>
        <td>
            Floating point std::to_chars has a pretty large code size impact
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            enhancement,
            libc++
      </td>
    </tr>

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

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

<pre>
    I've measured Ryu to increase the size of libc++ by 163 KiB even when optimizing for size. A lot of that comes from the precomputed tables. That's a substantial size increase for mobile apps.

Some ideas that could help (that I haven't measured yet):
* Ryu supports [RYU_OPTIMIZE_SIZE](https://github.com/search?q=repo%3Aulfjack%2Fryu%20RYU_OPTIMIZE_SIZE&type=code) to shrink the size of the tables, which we should be able to port over to libc++'s implementation.
* This would be a much larger change, but fmtlib uses [dragonbox](https://github.com/jk-jeon/dragonbox) instead of Ryu, which claims to be faster and seems to be smaller as well.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEU8uO4zYQ_Br60hhDpvyQDjrY6zVgBEGC2ckhexm0qLbJGYpU2C073q8PqHk4QYDkYlotVDWrSoXM7hyIGrXaqdV-hqPYmBruiQK6WRu7W3NUenMh6Al5TNTB420EieCCSYRMIJaA3Q-CeALvWqP0TukdtDdYrEv4ye2ALhTgailAHMT17ocLZzjFNMHmsAUfJaPFooCJPTGcUuwn5iGRif0wCnUg2HriOTxZFKU3DAg8tiwYxKF_u8TntTJ_H1vnCXAYeK6KvSq2b7_fYk_gOkL-2Dn6Diz5AZSuptERLF4oKL2Ru_QbidK1Kt9plN5ObvA4DDEJg1rtHn__7fmXX5-OPx-_f33-dvz-Va32SldWZOAM1AelD2cndmznJvZKH5gwGavKwx-q3CcaotKrcjv60wuaV6VX-pBuYz6Lf3PrtdwGUuXexI6UrnMwbJMLr_-IJf9_M0_pL3C1zli4ErCddLcE-V3GZhkQL5Tywz3MyWzXD556CoLiYpjfLXiyjuH6SQX9aCx4TGdKYCyGM-Wt7Shw6sW7Fkamyasu4TmGNv75vx69vD68UAxKH-4YXYMLLIRdlviYPfrQZjy6nrOGluCELJQAQwdM9DnmHr3Pc4YreT-fdU3Z1WWNM2oW67pY1vWiqma2qYuqK01XFeUSy5qKDS4rXHaLAk9LszktZq7RhS6Ljd7osljrat5WC6qXWK42ZUutKdSyoB6dn3t_6ecxnWeOeaRmvVxUxcxjS56nBmpNwWIwk81Ka6W_KK3_noPOLU1NJnpoxzOrZeEdC9-pxYmn5uAjSq7ZEF0QYOmyseVW4rOxmBgs5voMiURub2FB_obeS9QPaGQ2Jt_8Ryh55fvxMKT4QkaUPkzSWOnDpO6vAAAA__8CfXEd">