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

Method get_optimizer_stats

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

Source from the content-addressed store, hash-verified

529 }
530
531 def get_optimizer_stats(self) -> dict[str, tuple[int, int | None]]:
532 attempts = self._data["Optimization optimizer attempts"]
533 successes = self._data["Optimization optimizer successes"]
534 no_memory = self._data["Optimization optimizer failure no memory"]
535 builtins_changed = self._data["Optimizer remove globals builtins changed"]
536 incorrect_keys = self._data["Optimizer remove globals incorrect keys"]
537
538 return {
539 Doc(
540 "Optimizer attempts",
541 "The number of times the trace optimizer (_Py_uop_analyze_and_optimize) was run.",
542 ): (attempts, None),
543 Doc(
544 "Optimizer successes",
545 "The number of traces that were successfully optimized.",
546 ): (successes, attempts),
547 Doc(
548 "Optimizer no memory",
549 "The number of optimizations that failed due to no memory.",
550 ): (no_memory, attempts),
551 Doc(
552 "Remove globals builtins changed",
553 "The builtins changed during optimization",
554 ): (builtins_changed, attempts),
555 Doc(
556 "Remove globals incorrect keys",
557 "The keys in the globals dictionary aren't what was expected",
558 ): (incorrect_keys, attempts),
559 }
560
561 def get_jit_memory_stats(self) -> dict[Doc, tuple[int, int | None]]:
562 jit_total_memory_size = self._data["JIT total memory size"]

Callers 1

calc_optimizer_tableFunction · 0.80

Calls 1

DocClass · 0.70

Tested by

no test coverage detected