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

Method get_specialization_counts

Tools/scripts/summarize_stats.py:251–269  ·  view source on GitHub ↗
(self, opcode: str)

Source from the content-addressed store, hash-verified

249 return sum(family_stats.get(kind, 0) for kind in TOTAL)
250
251 def get_specialization_counts(self, opcode: str) -> dict[str, int]:
252 family_stats = self._get_stats_for_opcode(opcode)
253
254 result = {}
255 for key, value in sorted(family_stats.items()):
256 if key.startswith("specialization."):
257 label = key[len("specialization.") :]
258 if label in ("success", "failure") or label.startswith("failure_kinds"):
259 continue
260 elif key in (
261 "execution_count",
262 "specializable",
263 ) or key.startswith("pair"):
264 continue
265 else:
266 label = key
267 result[label] = value
268
269 return result
270
271 def get_specialization_success_failure(self, opcode: str) -> dict[str, int]:
272 family_stats = self._get_stats_for_opcode(opcode)

Callers 1

calcFunction · 0.80

Calls 3

_get_stats_for_opcodeMethod · 0.95
itemsMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected