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

Function calc_specialization_table

Tools/scripts/summarize_stats.py:882–904  ·  view source on GitHub ↗
(opcode: str)

Source from the content-addressed store, hash-verified

880
881def specialization_section() -> Section:
882 def calc_specialization_table(opcode: str) -> RowCalculator:
883 def calc(stats: Stats) -> Rows:
884 DOCS = {
885 "deferred": 'Lists the number of "deferred" (i.e. not specialized) instructions executed.',
886 "hit": "Specialized instructions that complete.",
887 "miss": "Specialized instructions that deopt.",
888 "deopt": "Specialized instructions that deopt.",
889 }
890
891 opcode_stats = stats.get_opcode_stats("opcode")
892 total = opcode_stats.get_specialization_total(opcode)
893 specialization_counts = opcode_stats.get_specialization_counts(opcode)
894
895 return [
896 (
897 Doc(label, DOCS[label]),
898 Count(count),
899 Ratio(count, total),
900 )
901 for label, count in specialization_counts.items()
902 ]
903
904 return calc
905
906 def calc_specialization_success_failure_table(name: str) -> RowCalculator:
907 def calc(stats: Stats) -> Rows:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…