You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Tim Armstrong (Jira)" <ji...@apache.org> on 2020/02/10 19:23:00 UTC

[jira] [Created] (IMPALA-9371) Investigate include-what-you-use to improve compile times

Tim Armstrong created IMPALA-9371:
-------------------------------------

             Summary: Investigate include-what-you-use to improve compile times
                 Key: IMPALA-9371
                 URL: https://issues.apache.org/jira/browse/IMPALA-9371
             Project: IMPALA
          Issue Type: Improvement
          Components: Infrastructure
            Reporter: Tim Armstrong


Impala compile times are longer than necessary because .cc files pull in a lot of headers, especially from the standard C++ library and boost. I looked at the preprocessor output for a couple of files, and it included ~400,000 lines of code, almost entirely from headers.

include-what-you-use is a tool that can identify cases where header includes can be avoided or moved from .h to .cc files to reduce the number of extraneous headers pulled into each compile unit.

Kudu has some tooling to run IWYU in a dev environment and also in their gerrit precommit.

I was able to run iwyu against Impala as follows:
{code}
# Clone repo and check out branch to match Impala toolchain's clang version
git clone https://github.com/include-what-you-use/include-what-you-use.git
cd include-what-you-use
git checkout clang_5.0

# Build IWYU against clang from toolchain
cmake -G "Unix Makefiles" -DIWYU_LLVM_ROOT_PATH=/opt/Impala-Toolchain/llvm-5.0.1-p2/ -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 ..
make -j $(nproc)
IWYU_BUILD_DIR=$(pwd)

# Run IWYU on the impala codebase.
cd $IMPALA_HOME
# Do an ASAN build to force Impala to generate compile_commands.json with compile commands suitable for clang.
./buildall.sh -noclean -notests -asan
PATH=$IWYU_BUILD_DIR:$PATH ~/repos/include-what-you-use/iwyu_tool.py -p . > iwyu.txt
{code}





--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org