I've temporarily named this script graph_header_deps2.py because graph_header_deps.py already exists — @EricWF wrote it in February 2020. My attempts to play around with graph_header_deps.py were mostly fruitless; I needed to modify it in various ways to make it work without a lot of structure around it, and then even when I got it working, it generated pretty ugly graphs.
Existing graph_header_deps.py usage (after my local changes to simplify the usage) (producing https://i.imgur.com/zATrsaP.jpg )
mkdir foo time ./graph_header_deps.py --libcxx-only -o foo --clang-command ~/llvm-project/build/bin/clang++ dot -Tpng < foo/all_headers.dot > old.png file old.png real 0m37.453s user 0m34.025s sys 0m2.742s old.png: PNG image data, 25882 x 3035, 8-bit/color RGBA, non-interlaced
New graph_header_deps2.py usage (producing https://i.imgur.com/ZU0G52U.png )
time ./graph_header_deps2.py | dot -Tpng > new.png file new.png real 0m1.063s user 0m0.837s sys 0m0.077s new.png: PNG image data, 6162 x 1344, 8-bit/color RGBA, non-interlaced