(stats: Stats)
| 792 | |
| 793 | def pair_count_section(prefix: str, title=None) -> Section: |
| 794 | def calc_pair_count_table(stats: Stats) -> Rows: |
| 795 | opcode_stats = stats.get_opcode_stats(prefix) |
| 796 | pair_counts = opcode_stats.get_pair_counts() |
| 797 | total = opcode_stats.get_total_execution_count() |
| 798 | |
| 799 | cumulative = 0 |
| 800 | rows: Rows = [] |
| 801 | for (opcode_i, opcode_j), count in itertools.islice( |
| 802 | sorted(pair_counts.items(), key=itemgetter(1), reverse=True), 100 |
| 803 | ): |
| 804 | cumulative += count |
| 805 | rows.append( |
| 806 | ( |
| 807 | f"{opcode_i} {opcode_j}", |
| 808 | Count(count), |
| 809 | Ratio(count, total), |
| 810 | Ratio(cumulative, total), |
| 811 | ) |
| 812 | ) |
| 813 | return rows |
| 814 | |
| 815 | return Section( |
| 816 | "Pair counts", |
nothing calls this directly
no test coverage detected
searching dependent graphs…