r217792 - Teach Clang how to use response files when calling other tools

Rafael Espíndola rafael.espindola at gmail.com
Thu Sep 18 16:20:19 PDT 2014


> +// REQUIRES: long_tests

I got curious as to why this was slow. I ran perf on

./bin/clang -E @..../response-file.c.tmp.1.txt response-file.c  -###

The results are interesting

  39.24%  clang  clang-3.6                     [.]
llvm::opt::Option::matches(llvm::opt::OptSpecifier) const
                                     ▒
  25.58%  clang  clang-3.6                     [.]
llvm::opt::Option::Option(llvm::opt::OptTable::Info const*,
llvm::opt::OptTable const*)                     ▒
  14.84%  clang  clang-3.6                     [.]
llvm::opt::OptTable::getOption(llvm::opt::OptSpecifier) const
                                     ▒
   1.68%  clang  libc-2.18.so                  [.] strlen

Now, there are 300_000 options in the response file, but adding a
counter to ] llvm::opt::Option::matches shows that it is called about
349_802_000 times :-)

Is this a now issue? Is it worth fixing?

Cheers,
Rafael




More information about the cfe-commits mailing list