Commit e2a44f0
committed
[Coverage] Speed up function record iteration
When iterating over function records, filtered by file name, currently,
the iteration goes over all the function records, repeatedly for each
source file, essentially giving quadratic behavior.
413647d sped up some cases by keeping
track of the indices of the function records corresponding to each
file name. This change expands the use of that map to
FunctionRecordIterator.
On a test case with Firefox's libxul.so and a 2.5MB profile, this brings
down the runtime of `llvm-cov export $lib --instr-profile $prof -t lcov`
from 12 minutes with 90% spent in skipOtherFiles to 19 seconds with no
samples in skipOtherFiles at all under a sampling profiler (with a
sampling interval of 1ms).
Fixes #620791 parent f325e4b commit e2a44f0
File tree
2 files changed
+41
-7
lines changed- llvm
- include/llvm/ProfileData/Coverage
- lib/ProfileData/Coverage
2 files changed
+41
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
751 | 754 | | |
752 | 755 | | |
753 | 756 | | |
754 | 757 | | |
| 758 | + | |
| 759 | + | |
755 | 760 | | |
756 | 761 | | |
757 | 762 | | |
| |||
760 | 765 | | |
761 | 766 | | |
762 | 767 | | |
763 | | - | |
764 | | - | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
765 | 779 | | |
766 | 780 | | |
767 | 781 | | |
| |||
774 | 788 | | |
775 | 789 | | |
776 | 790 | | |
777 | | - | |
778 | | - | |
| 791 | + | |
779 | 792 | | |
780 | 793 | | |
781 | 794 | | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
782 | 814 | | |
783 | 815 | | |
784 | 816 | | |
| |||
1037 | 1069 | | |
1038 | 1070 | | |
1039 | 1071 | | |
1040 | | - | |
1041 | | - | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1042 | 1076 | | |
1043 | 1077 | | |
1044 | 1078 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
| 621 | + | |
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
| |||
0 commit comments