The include cost of a header is its size plus the size of all transitively included headers. The goal is to measure the impact on the parsing time in clang. That's why
- the cost is measured in bytes and not in lines of code
- the size of files without header guards is added each time the file is included
- code excluded by the pre-processor is not counted towards the total because clang is able to skip such blocks of code efficiently
- comments over certain length are not counted towards the total because clang is able to skip such blocks of code efficiently
To obtain the data we
- check out fresh sources of libc++
- build libc++
- for each file required by C++ standard and provided by libc++
- for each supported language version
- measure the cost of including such file
- TODO: should we exclude the sizes of built-in and libc headers?