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

Method get_specialized_total_counts

Tools/scripts/summarize_stats.py:324–341  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

322 return "specializable" in self._get_stats_for_opcode(opcode)
323
324 def get_specialized_total_counts(self) -> tuple[int, int, int]:
325 basic = 0
326 specialized_hits = 0
327 specialized_misses = 0
328 not_specialized = 0
329 for opcode, opcode_stat in self._data.items():
330 if "execution_count" not in opcode_stat:
331 continue
332 count = opcode_stat["execution_count"]
333 if "specializable" in opcode_stat:
334 not_specialized += count
335 elif opcode in self._specialized_instructions:
336 miss = opcode_stat.get("specialization.miss", 0)
337 specialized_hits += count - miss
338 specialized_misses += miss
339 else:
340 basic += count
341 return basic, specialized_hits, specialized_misses, not_specialized
342
343 def get_deferred_counts(self) -> dict[str, int]:
344 return {

Calls 2

itemsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected