Callgrind: Profile a specific part of my code

后端 未结 2 432
臣服心动
臣服心动 2020-12-28 18:01

I\'m trying to profile (with Callgrind) a specific part of my code by removing noise and computation that I don\'t care about. Here is an example of what I want to do:

2条回答
  •  长发绾君心
    2020-12-28 18:47

    I finally managed to solve this issue... This was a config issue:

    I kept the code

    for (int i=0; i

    But ran the callgrind with --collect-atstart=no (and without the --instr-atstart=no!!!) and it worked perfectly, in a reasonable time (~1min).

    The issue with START/STOP instrumentation was that callgrind dumps a file (callgrind.out.#number) at each iteration (each STOP) thus it was really really slow... (after 5min I had only 5000 runs for a 300 000 iterations benchmark... unsuitable for a regression test).

提交回复
热议问题