Better HN
topnewbestaskshowjobs
Log inSign up

gpu64

13 karma · joined Oct 18, 2023 (3y ago) · 3 submissions

Submissions

comment 3y ago · link · parent

Yeah, how much modules/PCHs would help probably depends a lot on your code base. I read about clangs work on modules and they seemed a bit uncertain if you'd get much benefit at all once you switch on optimizations. https://clang.llvm.org/docs/StandardCPlusPlusModules.html#ho...

comment 3y ago · link · parent

I used cloc so blank lines and comments should be ignored.

comment 3y ago · link · parent

It's crazy to see how much work header files make the C++ compiler do just to build hello world:

    $ gcc -E hello.c | cloc --force-lang=c -
    419
    $ g++ -E -std=c++11 hello_iostream.cpp | cloc --force-lang=c++ -
    20707
    $ g++ -E -std=c++20 hello_iostream.cpp | cloc --force-lang=c++ -
    30876
    $ g++ -E -std=c++20 hello_std_format.cpp | cloc --force-lang=c++ -
    42757
Just bumping the C++ std version can add thousands of lines of code.