简体   繁体   中英

How to make lcov perform faster?

I'm having performance issues with lcov.

I'm executing a program in seven different profiles, collecting the coverage for each of them and then merging the coverage profile with lcov:

lcov --rc lcov_branch_coverage=1 -a coverage_1.dat -a coverage_2.dat -a coverage_3.dat -a coverage_4.dat -a coverage_5.dat -a coverage_6.dat -a coverage_7.dat -o coverage_full.dat

However, this is excruciatingly slow. It takes about 10 minutes to combine my 7 profiles, this is actually longer than it takes to compile and run the 7 profiles. Each dat file is about 1M lines.

The lcov --combine and lcov --remove steps are very slow as well. Around 45 seconds for each of them.

Is there any way to speedup this combine step? I can use several threads if necessary and I have got plenty of memory. If there are other tool that are able to do this combination correctly, I'd be interest as well (I've tried to convert the files to Cobertura and do the merge with a Python script I found, but it crashes).

If there is an alternative to lcov completely, I'm also interested. I've been using gcovr, but with it, I have to use several other tools to do the combination and it is not optimal, but it is much faster.

If there is an alternative to lcov completely, I'm also interested.

Try fastcov - it will use all available cores in parallel (it can output the report in lcov info format):

https://github.com/RPGillespie6/fastcov

It can also combine files. Note: You need GCC 9+

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM