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

Function calc_misses_by_table

Tools/scripts/summarize_stats.py:1047–1059  ·  view source on GitHub ↗
(stats: Stats)

Source from the content-addressed store, hash-verified

1045 ]
1046
1047 def calc_misses_by_table(stats: Stats) -> Rows:
1048 opcode_stats = stats.get_opcode_stats("opcode")
1049 misses_counts = opcode_stats.get_misses_counts()
1050 total = sum(misses_counts.values())
1051 if total == 0:
1052 return []
1053
1054 return [
1055 (name, Count(value), Ratio(value, total))
1056 for name, value in sorted(
1057 misses_counts.items(), key=itemgetter(1), reverse=True
1058 )[:10]
1059 ]
1060
1061 return Section(
1062 "Specialization effectiveness",

Callers

nothing calls this directly

Calls 7

itemgetterClass · 0.90
CountClass · 0.85
get_opcode_statsMethod · 0.80
get_misses_countsMethod · 0.80
RatioClass · 0.70
valuesMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…