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

Method get_opcode_stats

Tools/scripts/summarize_stats.py:374–385  ·  view source on GitHub ↗
(self, prefix: str)

Source from the content-addressed store, hash-verified

372
373 @functools.cache
374 def get_opcode_stats(self, prefix: str) -> OpcodeStats:
375 opcode_stats = collections.defaultdict[str, dict](dict)
376 for key, value in self._data.items():
377 if not key.startswith(prefix):
378 continue
379 name, _, rest = key[len(prefix) + 1 :].partition("]")
380 opcode_stats[name][rest.strip(".")] = value
381 return OpcodeStats(
382 opcode_stats,
383 self._data["_defines"],
384 self._data["_specialized_instructions"],
385 )
386
387 def get_call_stats(self) -> dict[str, int]:
388 defines = self._data["_stats_defines"]

Callers 9

calcFunction · 0.80
calc_pair_count_tableFunction · 0.80
calc_deferred_by_tableFunction · 0.80
calc_misses_by_tableFunction · 0.80

Calls 5

OpcodeStatsClass · 0.85
itemsMethod · 0.45
startswithMethod · 0.45
partitionMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected