-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
<charconv>
is intentionally header-only, as this allows either C1XX/C2 or Clang/LLVM to be used. However, the lookup tables are just plain old data, and their presence in the headers has several undesirable effects:
- This is 385 KB of source code that must be compiled. That's a throughput cost.
- They emit 121 KB of constant data, increasing the size of each object file by at least that much. Also a throughput cost.
- As reported in Fix Run-Time Check Failure #171, this increases PCH memory consumption, possibly exceeding the default limit.
- The optimizer doesn't benefit from being able to see within the lookup tables.
We should separately compile the large lookup tables (there are a number of small ones that could remain header-only for convenience). We should probably compile them into the static/import lib, which would preserve their opt-in cost (if someone doesn't use <charconv>
, they don't pay the cost). Compiling them into a satellite DLL would be logistically more complicated, and would increase the size of the redist even if no programs use <charconv>
(although there would be a minor memory savings if multiple programs could share a DLL).