Skip to content

Commit 477957f

Browse files
committed
lcov: Reduce load times for complex coverage data files
lcov uses a significant amount of time loading coverage data files containing complex branch coverage data (i.e. data with a large number of branches per basic block). Most of this time is spent storing branch coverage data in a vector-based data representation, with an unnecessary amount of cross-checking being done for existing branch data. Fix this by replacing the vector based data representation by two separate representations, scalar for storage and hash for processing, and by moving cross-checking out of the hot path. This results in a significant speedup at the cost of a minor increase in memory usage. Test results for "make test SIZE=large": Original: 17 tests executed, 17 passed, 0 failed, 0 skipped (time 1883.9s, mem 2459.0MB) Patched: 17 tests executed, 17 passed, 0 failed, 0 skipped (time 283.6s, mem 2544.2MB) Note that this fix only applies to the lcov tool. The same work is necessary for genhtml. This approach was inspired by a patch by creich.3141592@gmail.com. Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
1 parent 3b397a3 commit 477957f

File tree

1 file changed

+114
-249
lines changed

1 file changed

+114
-249
lines changed

0 commit comments

Comments
 (0)