MCPcopy Index your code
hub / github.com/python/cpython / calc_execution_count_table

Function calc_execution_count_table

Tools/scripts/summarize_stats.py:745–771  ·  view source on GitHub ↗
(prefix: str)

Source from the content-addressed store, hash-verified

743
744
745def calc_execution_count_table(prefix: str) -> RowCalculator:
746 def calc(stats: Stats) -> Rows:
747 opcode_stats = stats.get_opcode_stats(prefix)
748 counts = opcode_stats.get_execution_counts()
749 total = opcode_stats.get_total_execution_count()
750 cumulative = 0
751 rows: Rows = []
752 for opcode, (count, miss) in sorted(
753 counts.items(), key=itemgetter(1), reverse=True
754 ):
755 cumulative += count
756 if miss:
757 miss_val = Ratio(miss, count)
758 else:
759 miss_val = None
760 rows.append(
761 (
762 opcode,
763 Count(count),
764 Ratio(count, total),
765 Ratio(cumulative, total),
766 miss_val,
767 )
768 )
769 return rows
770
771 return calc
772
773
774def execution_count_section() -> Section:

Callers 2

execution_count_sectionFunction · 0.85
iter_optimization_tablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…