[cfe-dev] clang-rename performance oddness

Miklos Vajna via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 17 07:13:56 PDT 2016


Hi,

On Tue, Aug 16, 2016 at 03:35:07PM -0500, "Craig, Ben via cfe-dev" <cfe-dev at lists.llvm.org> wrote:
> I doubt that most of your time is being spent in ParseAST() itself.
> ParseAST has lots and lots of callbacks into code that does the "real" work.
> I would expect most of the time spent to be somewhere under ParseAST.

Yes, I guess so; though I could not identify a single hotspot in the
called methods.

> If you are on Linux, I would recommend using 'perf' to collect your profile,
> and FlameGraph (https://github.com/brendangregg/FlameGraph) to visualize it.
> Make sure you build with -fno-omit-frame-pointer, as otherwise perf will
> likely not have useful information.

Ah great, that allows me to share the recorded profile, unlike valgrind:

https://people.freedesktop.org/~vmiklos/2016/clang-rename.svg

> Having assertions on can cause more overhead than you think.  When I last
> did profiling, I noticed that the allocation behavior changed a lot with
> assertions turned on.  The clang / llvm allocators would start poisoning and
> verifying empty memory during alloc / free.

Hmm, indeed. Disabling assertions helps a bit, now clang-rename is down
from ~75 secs to 60 secs. But still a large ~60 vs 5 seconds gap.

Regards,

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160817/d23730a4/attachment.sig>


More information about the cfe-dev mailing list