{
  "id": "task_libraries:profiling/python",
  "path": "/exapedia/python-profiling-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python profiling libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python profiling libraries measure where a program spends its time or memory, down to the function or line. A sampling profiler records the call stack at intervals rather than timing every function call. These libraries let developers find the code that slows down a service or exhausts its memory."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python profiling libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#py-spy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F132"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F136"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#memray",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F150"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyinstrument",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#memory-profiler",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F188"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#yappi",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F206"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#line-profiler-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F222"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#viztracer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F240"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scalene",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F258"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F265"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F262"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F260"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#py-spy",
          "label": [
            {
              "t": "text",
              "text": "py-spy"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F133"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Python API",
            "Execution timing",
            "Memory profiling"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#py-spy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F132"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#memray",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F150"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyinstrument",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#memory-profiler",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F188"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#yappi",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F206"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#line-profiler-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F222"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#viztracer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F240"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F252"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#scalene",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F258"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F266"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F267"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F268"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "py-spy",
          "name": [
            {
              "t": "fact",
              "fact": "F132"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/benfred/py-spy"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/py-spy"
            },
            {
              "label": "Docs",
              "href": "https://github.com/benfred/py-spy/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F139"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/benfred/py-spy/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F132"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/xai-org/x-algorithm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F148"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def start_pyspy_trace(dir_path: os.PathLike, blocking: bool = False, rate: int = 100) -> None:\n    with _pyspy_state.lock:\n        if _pyspy_state.process is not None:\n            raise RuntimeError(\"Only one py-spy profile may be run at a time.\")\n\n        timestamp = datetime.now().strftime(\"%Y-%m-%dT%H:%M:%SZ\")\n        pid = os.getpid()\n        output_path = Path(dir_path) / f\"{pid}-{timestamp}.json\"\n        output_path.parent.mkdir(parents=True, exist_ok=True)\n        logger.info(f\"Profiling to {output_path}...\")\n\n        cmd = [\n            \"py-spy\",\n            \"record\",\n            \"--pid\",\n            str(pid),\n            \"--format\",\n            \"speedscope\",\n            \"--nonblocking\" if not blocking else \"--native\",\n            \"--rate\",\n            f\"{rate}\",\n            \"-o\",\n            str(output_path),\n        ]\n\n        env = os.environ.copy()\n        env[\"RUST_LOG\"] = \"warn\"\n\n        process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)\n        _pyspy_state.process = process\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/xai-org/x-algorithm/blob/b55151777cd8901111c7b5985a724f671f05d2c4/phoenix/xrex/utils/pyspy_profiler.py#L27-L56",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F147"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=py-spy%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F132"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "py-spy record -o profile.svg -- python your_script.py\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/benfred/py-spy/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F137"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "memray",
          "name": [
            {
              "t": "fact",
              "fact": "F150"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/bloomberg/memray"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/memray"
            },
            {
              "label": "Docs",
              "href": "https://github.com/bloomberg/memray/blob/main/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F157"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/bloomberg/memray/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F150"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/bloomberg/pytest-memray",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F166"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@contextmanager\ndef memory_reporting() -> Generator[Tuple[Tracker, bool], None, None]:\n    # Restore the original function. This is needed because some\n    # pytest plugins (e.g. flaky) will call our pytest_pyfunc_call\n    # hook again with whatever is here, which will cause the wrapper\n    # to be wrapped again.\n    pyfuncitem.obj = func\n\n    result_file = _build_bin_path()\n    tracker_kwargs = {\n        \"native_traces\": native,\n        \"trace_python_allocators\": trace_python_allocators,\n        \"file_format\": FileFormat.AGGREGATED_ALLOCATIONS,\n    }\n\n    # Add track_object_lifetimes if tracking objects\n    if track_objects:  # pragma: no cover\n        tracker_kwargs[\"track_object_lifetimes\"] = True\n\n    # mypy can't resolve the overload when using **kwargs unpacking\n    tracker = Tracker(result_file, **tracker_kwargs)  # type: ignore[call-overload]\n    yield (tracker, track_objects)\n\n    # Get surviving objects if tracking was enabled\n    surviving_objects = None\n    if track_objects:  # pragma: no cover\n        surviving_objects = list(tracker.get_surviving_objects())\n\n    try:\n        metadata = FileReader(result_file).metadata\n    except OSError:\n        return\n    result = Result(pyfuncitem.nodeid, metadata.peak_memory, result_file)\n\n    with NamedTemporaryFile(\n        dir=self.result_metadata_path,\n        delete=False,\n    ) as tmp_file:\n        tmp_file.write(\n            json.dumps(\n                {\n                    \"test_id\": result.test_id,\n                    \"peak_memory\": result.peak_memory,\n                    \"result_file\": str(result.result_file),\n                }\n            ).encode(\"utf-8\")\n        )\n\n    metadata_filename = result_file.with_suffix(\".metadata\").name\n    os.replace(tmp_file.name, self.result_metadata_path / metadata_filename)\n\n    self.results[pyfuncitem.nodeid] = result\n\n    # Store surviving objects separately (they can't be serialized)\n    if surviving_objects is not None:  # pragma: no cover\n        self.surviving_objects[pyfuncitem.nodeid] = surviving_objects\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/bloomberg/pytest-memray/blob/e1f35e2a1aa7c6d4a6a485a90bdae245efaff942/src/pytest_memray/plugin.py#L230-L285",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F165"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=memray%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F150"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import memray\n\nwith memray.Tracker(\"profile.bin\"):\n    values = [i * i for i in range(10000)]\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://bloomberg.github.io/memray/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "api.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F155"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pyinstrument",
          "name": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/joerick/pyinstrument"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pyinstrument"
            },
            {
              "label": "Docs",
              "href": "https://github.com/joerick/pyinstrument/blob/main/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F11"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/joerick/pyinstrument/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F168"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F12"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/treeverse/dvc",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@contextmanager\ndef instrument(html_output=False):\n    \"\"\"Run a statistical profiler\"\"\"\n    try:\n        from pyinstrument import Profiler  # ty: ignore[unresolved-import]\n    except ImportError:\n        print(\"Failed to run profiler, pyinstrument is not installed\")  # noqa: T201\n        yield\n        return\n\n    profiler = Profiler()\n\n    profiler.start()\n    try:\n        yield\n    finally:\n        profiler.stop()\n\n        if html_output:\n            profiler.open_in_browser()\n        else:\n            print(profiler.output_text(unicode=True, color=True))  # noqa: T201\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/treeverse/dvc/blob/b59add99ee667f2b352cc1be337619f965fe3fea/dvc/_debug.py#L78-L99",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20pyinstrument%20for%20profiler%20lifecycle%20control%2C%20merged%20sessions%2C%20clock%20selection%20and%20source-line%20registration&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F168"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/holoviz/panel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F186"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def render_pyinstrument(sessions, timeline=False, show_all=False):\n    from pyinstrument.renderers import HTMLRenderer\n    from pyinstrument.session import Session\n    r = HTMLRenderer(timeline=timeline, show_all=show_all)\n    if timeline:\n        session = sessions[-1]\n    else:\n        session = sessions[0]\n        for s in sessions[1:]:\n            session = Session.combine(session, s)\n    try:\n        rendered = r.render(session)\n    except Exception:\n        rendered = \"<h2><b>Rendering pyinstrument session failed</b></h2>\"\n    return escape(rendered), \"\"\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/holoviz/panel/blob/ea4f3836f84b11864638a7c951f4db84d7049f61/panel/io/profile.py#L29-L43",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F185"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20pyinstrument%20for%20profiler%20lifecycle%20control%2C%20merged%20sessions%2C%20clock%20selection%20and%20source-line%20registration&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F168"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from pyinstrument import Profiler\nimport time\n\nprofiler = Profiler()\nprofiler.start()\ntime.sleep(0.05)\nprofiler.stop()\nprint(profiler.output_text())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/joerick/pyinstrument/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "guide.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F173"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "memory-profiler",
          "name": [
            {
              "t": "fact",
              "fact": "F188"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/pythonprofilers/memory_profiler"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/memory-profiler"
            },
            {
              "label": "Docs",
              "href": "https://github.com/pythonprofilers/memory_profiler/blob/master/README.rst"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F195"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/pythonprofilers/memory_profiler/blob/master/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F188"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/facebookresearch/fairseq",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F204"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def max_memory(self, dataset, repeat):\n    \"\"\"Compute average max memory consumed by model inference. Units are MiB\"\"\"\n    logger.info(\"Starting memory benchmarking\")\n    total_memory = 0\n    for i, sample in enumerate(dataset):\n        for _r in range(repeat):\n            total_memory += max(memory_usage((self.forward, (sample,), {})))\n        if i % 100 == 0:\n            logger.info(f\"Benchmarked memory for {i}/{len(dataset)} samples\")\n    total_memory = total_memory / (repeat * len(dataset))\n    return total_memory\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/facebookresearch/fairseq/blob/3d262bb25690e4eb2e7d3c1309b1e9c406ca4b99/examples/speech_to_speech/benchmarking/core.py#L75-L85",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F203"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=memory-profiler%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F188"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from memory_profiler import memory_usage\n\nprint(memory_usage(-1, interval=0.1, timeout=0.2))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/pythonprofilers/memory_profiler/master/memory_profiler.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "memory_profiler.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F193"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "yappi",
          "name": [
            {
              "t": "fact",
              "fact": "F206"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/sumerc/yappi"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/yappi"
            },
            {
              "label": "Docs",
              "href": "https://github.com/sumerc/yappi/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F40"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F209"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/sumerc/yappi/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F206"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F46"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F47"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F48"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/oVirt/vdsm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F220"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def stop(self):\n    if not yappi.is_running():\n        raise UsageError(\"CPU profiler is not running\")\n\n    logging.info(\"Stopping CPU profiling\")\n    yappi.stop()\n    stats = yappi.get_func_stats()\n    stats.save(self.filename, self.format)\n    yappi.clear_stats()\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/oVirt/vdsm/blob/ac6a32ec9eeefd9f909acc3017824bff93abe15a/lib/vdsm/profiling/cpu.py#L57-L65",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F219"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20yappi%20for%20profiler%20lifecycle%20control%2C%20merged%20sessions%2C%20clock%20selection%20and%20source-line%20registration&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F206"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import yappi\n\ndef work():\n    return sum(i * i for i in range(10000))\n\nyappi.start()\nwork()\nyappi.stop()\nyappi.get_func_stats().print_all()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/sumerc/yappi/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F211"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "line-profiler-library",
          "name": [
            {
              "t": "fact",
              "fact": "F222"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/pyutils/line_profiler"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/line-profiler"
            },
            {
              "label": "Docs",
              "href": "https://github.com/pyutils/line_profiler/blob/main/README.rst"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F229"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/pyutils/line_profiler/blob/main/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F222"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/apache/cassandra",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F238"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def profile_on(fcn_names=None):\n    if fcn_names and HAS_LINE_PROFILER:\n        pr = LineProfiler()\n        for fcn_name in fcn_names:\n            pr.add_function(fcn_name)\n        pr.enable()\n        return pr\n\n    pr = cProfile.Profile()\n    pr.enable()\n    return pr\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/apache/cassandra/blob/7d7d6b30dbd3c4d87c7dd89de87ab1318977be39/pylib/cqlshlib/util.py#L115-L125",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F237"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=line-profiler%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F222"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from line_profiler import LineProfiler\n\ndef total():\n    return sum(range(10000))\n\nprofiler = LineProfiler()\nprofiler.add_function(total)\nprofiler.enable()\ntotal()\nprofiler.disable()\nprofiler.print_stats()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/pyutils/line_profiler/blob/v5.1.0/line_profiler/line_profiler.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "line_profiler.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F227"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "viztracer",
          "name": [
            {
              "t": "fact",
              "fact": "F240"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/gaogaotiantian/viztracer"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/viztracer"
            },
            {
              "label": "Docs",
              "href": "https://github.com/gaogaotiantian/viztracer/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F247"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/gaogaotiantian/viztracer/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F240"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F257"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/triton-inference-server/pytriton",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F256"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@classmethod\ndef _run_server(cls, registry, address, authkey, serializer, writer, initializer=None, initargs=()):\n    PR_SET_PDEATHSIG = 1  # noqa\n    libc = ctypes.CDLL(ctypes.util.find_library(\"c\"), use_errno=True)\n    libc.prctl(PR_SET_PDEATHSIG, signal.SIGTERM)  # terminate process when parent **thread** dies\n\n    if bool(os.environ.get(\"PYTRITON_VIZTRACER\")):\n        from viztracer import VizTracer  # type: ignore # pytype: disable=import-error\n\n        cls._tracer = VizTracer(log_async=True, log_gc=True, tracer_entries=10000000, pid_suffix=True)\n        cls._tracer.register_exit()\n        cls._tracer.start()\n\n    super()._run_server(\n        registry, address, authkey, serializer, writer, initializer, initargs\n    )  # pytype: disable=attribute-error\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/triton-inference-server/pytriton/blob/88e92b5ec7cfdf8f22d4e9f00671db331f8288dc/pytriton/proxy/data.py#L380-L395",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F255"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=viztracer%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F240"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from viztracer import VizTracer\n\ndef work():\n    return sum(range(10000))\n\nwith VizTracer(output_file=\"trace.json\"):\n    work()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/gaogaotiantian/viztracer/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F245"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "scalene",
          "name": [
            {
              "t": "fact",
              "fact": "F258"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/plasma-umass/scalene"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/scalene"
            },
            {
              "label": "Docs",
              "href": "https://github.com/plasma-umass/scalene/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F91"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F265"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F261"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F260"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/plasma-umass/scalene/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F258"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F92"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F93"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F94"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F95"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F96"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F97"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F98"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F99"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "scalene run your_script.py\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/plasma-umass/scalene/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20scalene%20for%20profiler%20lifecycle%20control%2C%20merged%20sessions%2C%20clock%20selection%20and%20source-line%20registration&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F258"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F263"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python profiler should I use?",
      "a": [
        {
          "t": "link",
          "href": "#py-spy",
          "label": [
            {
              "t": "text",
              "text": "py-spy"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits profiling a running process without changing its code. "
        },
        {
          "t": "link",
          "href": "#pyinstrument",
          "label": [
            {
              "t": "text",
              "text": "Pyinstrument"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits readable call-stack reports from inside the program. "
        },
        {
          "t": "link",
          "href": "#memray",
          "label": [
            {
              "t": "text",
              "text": "Memray"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits tracking down memory allocations."
        }
      ]
    },
    {
      "q": "What is Scalene?",
      "a": [
        {
          "t": "link",
          "href": "#scalene",
          "label": [
            {
              "t": "text",
              "text": "Scalene"
            }
          ]
        },
        {
          "t": "text",
          "text": " samples CPU time, memory, and GPU activity and attributes them to Python and native code."
        }
      ]
    },
    {
      "q": "What is py-spy?",
      "a": [
        {
          "t": "link",
          "href": "#py-spy",
          "label": [
            {
              "t": "text",
              "text": "py-spy"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a sampling profiler that attaches to a running Python process from outside it. It needs no changes to the application and may require extra permissions to attach."
        }
      ]
    },
    {
      "q": "What is Memray?",
      "a": [
        {
          "t": "link",
          "href": "#memray",
          "label": [
            {
              "t": "text",
              "text": "Memray"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a memory profiler that tracks allocations from Python, the interpreter, and native code, with the stack that made each one."
        }
      ]
    },
    {
      "q": "How do I profile memory usage in Python?",
      "a": [
        {
          "t": "link",
          "href": "#memray",
          "label": [
            {
              "t": "text",
              "text": "Memray"
            }
          ]
        },
        {
          "t": "text",
          "text": " records each allocation and the code that made it. "
        },
        {
          "t": "link",
          "href": "#memory-profiler",
          "label": [
            {
              "t": "text",
              "text": "memory_profiler"
            }
          ]
        },
        {
          "t": "text",
          "text": " samples memory usage line by line or for a whole process."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, pyinstrument",
      "display": "Pyinstrument",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, pyinstrument",
      "display": "9.1M",
      "asOf": "2026-11-17"
    },
    "F3": {
      "label": "License, pyinstrument",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, pyinstrument",
      "display": "5.1.3, Jul 2026",
      "asOf": "2026-07-29"
    },
    "F5": {
      "label": "Package release date, pyinstrument",
      "display": "Jul 2026",
      "asOf": "2026-07-29"
    },
    "F6": {
      "label": "Repository stars, pyinstrument",
      "display": "8.0K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "CPU-time clock, pyinstrument",
      "display": "Unsupported",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Wall-time clock, pyinstrument",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Output formats, pyinstrument",
      "display": "HTML, JSON, Text",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Install, pyinstrument",
      "display": "pip install pyinstrument",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "What it does, pyinstrument",
      "display": "Samples Python call stacks to explain elapsed time across nested application work.",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "strengths lead, pyinstrument",
      "display": "Shows the full call stack",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths, pyinstrument",
      "display": "Trace elapsed time through callers and nested function work.",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, pyinstrument",
      "display": "Renders browser-readable reports",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, pyinstrument",
      "display": "Export HTML or JSON reports through its renderer interface.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "limitations lead, pyinstrument",
      "display": "Elapsed time includes I/O waits",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations, pyinstrument",
      "display": "Waiting for network, files, or databases contributes to reported duration.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, pyinstrument",
      "display": "Sampling omits exact call counts",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, pyinstrument",
      "display": "Sampled stacks describe elapsed activity rather than every function invocation.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Quickstart, pyinstrument",
      "display": "from pyinstrument import Profiler\n\nprofiler = Profiler()\nprofiler.start()\n\n# code you want to profile\n\nprofiler.stop()\nprofiler.print()\n\n",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project function, pyinstrument",
      "display": "def render_pyinstrument(sessions, timeline=False, show_all=False):\n    from pyinstrument.renderers import HTMLRenderer\n    from pyinstrument.session import Session\n    r = HTMLRenderer(timeline=timeline, show_all=show_all)\n    if timeline:\n        session = sessions[-1]\n    else:\n        session = sessions[0]\n        for s in sessions[1:]:\n            session = Session.combine(session, s)\n    try:\n        rendered = r.render(session)\n    except Exception:\n        rendered = \"<h2><b>Rendering pyinstrument session failed</b></h2>\"\n    return escape(rendered), \"\"\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function reference, pyinstrument",
      "display": "profile.py · render_pyinstrument()",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project repository, pyinstrument",
      "display": "holoviz/panel",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project stars, holoviz/panel",
      "display": "5.8K",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project push date, holoviz/panel",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F26": {
      "label": "Project function, pyinstrument",
      "display": "@contextmanager\ndef instrument(html_output=False):\n    \"\"\"Run a statistical profiler\"\"\"\n    try:\n        from pyinstrument import Profiler  # ty: ignore[unresolved-import]\n    except ImportError:\n        print(\"Failed to run profiler, pyinstrument is not installed\")  # noqa: T201\n        yield\n        return\n\n    profiler = Profiler()\n\n    profiler.start()\n    try:\n        yield\n    finally:\n        profiler.stop()\n\n        if html_output:\n            profiler.open_in_browser()\n        else:\n            print(profiler.output_text(unicode=True, color=True))  # noqa: T201\n",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Project function reference, pyinstrument",
      "display": "_debug.py · instrument()",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Project repository, pyinstrument",
      "display": "treeverse/dvc",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Project stars, treeverse/dvc",
      "display": "16.0K",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Project push date, treeverse/dvc",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F31": {
      "label": "Library name, yappi",
      "display": "Yappi",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Monthly downloads, yappi",
      "display": "2.9M",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "License, yappi",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Package release, yappi",
      "display": "1.7.6, Mar 2026",
      "asOf": "2026-03-17"
    },
    "F35": {
      "label": "Package release date, yappi",
      "display": "Mar 2026",
      "asOf": "2026-03-17"
    },
    "F36": {
      "label": "Repository stars, yappi",
      "display": "1.7K",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "CPU-time clock, yappi",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "Wall-time clock, yappi",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "Install, yappi",
      "display": "pip install yappi",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "What it does, yappi",
      "display": "Traces Python function calls with CPU or wall clocks and thread-aware profiling statistics.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths lead, yappi",
      "display": "Chooses CPU or wall time",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "strengths, yappi",
      "display": "Switch clocks to separate CPU consumption from elapsed waiting.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "strengths lead, yappi",
      "display": "Separates work by thread",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "strengths, yappi",
      "display": "Filter function statistics by thread context identifiers.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations lead, yappi",
      "display": "CPU timing omits blocked waits",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "limitations, yappi",
      "display": "Choose wall time when blocked I/O belongs in the measurement.",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "limitations lead, yappi",
      "display": "Results persist until explicitly cleared",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "limitations, yappi",
      "display": "Call yappi.clear_stats between independent profiling sessions.",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Quickstart, yappi",
      "display": "import yappi\nimport time\nimport threading\n\n_NTHREAD = 3\n\n\ndef _work(n):\n    time.sleep(n * 0.1)\n\n\nyappi.start()\n\nthreads = []\n# generate _NTHREAD threads\nfor i in range(_NTHREAD):\n    t = threading.Thread(target=_work, args=(i + 1, ))\n    t.start()\n    threads.append(t)\n# wait all threads to finish\nfor t in threads:\n    t.join()\n\nyappi.stop()\n\n# retrieve thread stats by their thread id (given by yappi)\nthreads = yappi.get_thread_stats()\nfor thread in threads:\n    print(\n        \"Function stats for (%s) (%d)\" % (thread.name, thread.id)\n    )  # it is the Thread.__class__.__name__\n    yappi.get_func_stats(ctx_id=thread.id).print_all()\n'''\nFunction stats for (Thread) (3)\n\nname                                  ncall  tsub      ttot      tavg\n..hon3.7/threading.py:859 Thread.run  1      0.000017  0.000062  0.000062\ndoc3.py:8 _work                       1      0.000012  0.000045  0.000045\n\nFunction stats for (Thread) (2)\n\nname                                  ncall  tsub      ttot      tavg\n..hon3.7/threading.py:859 Thread.run  1      0.000017  0.000065  0.000065\ndoc3.py:8 _work                       1      0.000010  0.000048  0.000048\n\n\nFunction stats for (Thread) (1)\n\nname                                  ncall  tsub      ttot      tavg\n..hon3.7/threading.py:859 Thread.run  1      0.000010  0.000043  0.000043\ndoc3.py:8 _work                       1      0.000006  0.000033  0.000033\n'''\n",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project function, yappi",
      "display": "def start(self):\n    # Lazy import so we do not effect runtime environment if profiling is\n    # not used.\n    global yappi\n    import yappi  # pylint: disable=import-error\n\n    # yappi start semantics are a bit too liberal, returning success if\n    # yappi is already started, happily having two different code paths\n    # that thinks they own the single process profiler.\n    if yappi.is_running():\n        raise UsageError('CPU profiler is already running')\n\n    logging.info(\"Starting CPU profiling\")\n    yappi.set_clock_type(self.clock)\n    yappi.start(builtins=self.builtins, profile_threads=self.threads)\n",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project function reference, yappi",
      "display": "cpu.py · start()",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Project repository, yappi",
      "display": "oVirt/vdsm",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Project stars, oVirt/vdsm",
      "display": "193",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Project push date, oVirt/vdsm",
      "display": "Nov 2026",
      "asOf": "2026-11-12"
    },
    "F55": {
      "label": "Library name, line_profiler",
      "display": "line_profiler",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Monthly downloads, line_profiler",
      "display": "2.0M",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "License, line_profiler",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Package release, line_profiler",
      "display": "5.1.0, Oct 2026",
      "asOf": "2026-10-18"
    },
    "F59": {
      "label": "Package release date, line_profiler",
      "display": "Oct 2026",
      "asOf": "2026-10-18"
    },
    "F60": {
      "label": "Repository stars, line_profiler",
      "display": "3.3K",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Wall-time clock, line_profiler",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Line-level timing, line_profiler",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "Output formats, line_profiler",
      "display": "Text",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "Install, line_profiler",
      "display": "pip install line_profiler",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "What it does, line_profiler",
      "display": "Measures time spent on individual source lines in selected Python functions.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths lead, line_profiler",
      "display": "Finds expensive source lines",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "strengths, line_profiler",
      "display": "Inspect elapsed time and hit counts for individual Python lines.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "strengths lead, line_profiler",
      "display": "Targets selected functions",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "strengths, line_profiler",
      "display": "Decorate the functions whose source lines need measurement.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations lead, line_profiler",
      "display": "Concurrent code needs validation",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "limitations, line_profiler",
      "display": "Threads, processes and async execution can produce unexpected or missing results.",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "limitations lead, line_profiler",
      "display": "GPU work needs synchronization",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "limitations, line_profiler",
      "display": "GPU timing reflects synchronizing Python calls rather than complete device execution.",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Quickstart, line_profiler",
      "display": "from line_profiler import profile\n\n\n@profile\ndef is_prime(n):\n    '''\n    Check if the number \"n\" is prime, with n > 1.\n\n    Returns a boolean, True if n is prime.\n    '''\n    max_val = n ** 0.5\n    stop = int(max_val + 1)\n    for i in range(2, stop):\n        if n % i == 0:\n            return False\n    return True\n\n\n@profile\ndef find_primes(size):\n    primes = []\n    for n in range(size):\n        flag = is_prime(n)\n        if flag:\n            primes.append(n)\n    return primes\n\n\n@profile\ndef main():\n    print('start calculating')\n    primes = find_primes(100000)\n    print(f'done calculating. Found {len(primes)} primes.')\n\n\nif __name__ == '__main__':\n    main()\n",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project function, line_profiler",
      "display": "def profile_on(fcn_names=None):\n    if fcn_names and HAS_LINE_PROFILER:\n        pr = LineProfiler()\n        for fcn_name in fcn_names:\n            pr.add_function(fcn_name)\n        pr.enable()\n        return pr\n\n    pr = cProfile.Profile()\n    pr.enable()\n    return pr\n",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Project function reference, line_profiler",
      "display": "util.py · profile_on()",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Project repository, line_profiler",
      "display": "apache/cassandra",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Project stars, apache/cassandra",
      "display": "10.2K",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Project push date, apache/cassandra",
      "display": "Nov 2026",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Library name, scalene",
      "display": "Scalene",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Monthly downloads, scalene",
      "display": "304.0K",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "License, scalene",
      "display": "Apache",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Package release, scalene",
      "display": "2.4.0, Oct 2026",
      "asOf": "2026-10-23"
    },
    "F84": {
      "label": "Package release date, scalene",
      "display": "Oct 2026",
      "asOf": "2026-10-23"
    },
    "F85": {
      "label": "Repository stars, scalene",
      "display": "13.6K",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "CPU-time clock, scalene",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "Wall-time clock, scalene",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "Line-level timing, scalene",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "Output formats, scalene",
      "display": "HTML, JSON, Text",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "Install, scalene",
      "display": "pip install scalene",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "What it does, scalene",
      "display": "Profiles source-line CPU activity and memory allocation, with optional NVIDIA GPU reporting.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "strengths lead, scalene",
      "display": "Attributes cost to source lines",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "strengths, scalene",
      "display": "Find Python lines responsible for CPU activity and memory growth.",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "strengths lead, scalene",
      "display": "Separates Python and native work",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "strengths, scalene",
      "display": "Distinguish Python execution from time spent in native extension code.",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "limitations lead, scalene",
      "display": "GPU timing needs NVIDIA hardware",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "limitations, scalene",
      "display": "GPU-time reporting is currently limited to NVIDIA-based systems.",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "limitations lead, scalene",
      "display": "Memory tests require a relaunch",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "limitations, scalene",
      "display": "Pytest memory mode restarts the session to initialize allocation tracking.",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Quickstart, scalene",
      "display": "# Profile a program (saves to scalene-profile.json)\nscalene run your_prog.py\npython3 -m scalene run your_prog.py              # equivalent alternative\n\n# View a profile\nscalene view                                     # open profile in browser\nscalene view --cli                               # view in terminal\nscalene view --html                              # save to scalene-profile.html\nscalene view --standalone                        # save as self-contained HTML\n\n# Common profiling options\nscalene run --cpu-only your_prog.py              # only profile CPU (faster)\nscalene run -o results.json your_prog.py         # custom output filename\nscalene run -c config.yaml your_prog.py          # load options from config file\n\n# Pass arguments to your program (use --- separator)\nscalene run your_prog.py --- --arg1 --arg2\n\n# Get help\nscalene --help                                   # main help\nscalene run --help                               # profiling options\nscalene run --help-advanced                      # advanced profiling options\nscalene view --help                              # viewing options\n",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need",
      "display": "Explaining elapsed request time",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Why choose pyinstrument",
      "display": "sampled full call stacks",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need in introduction",
      "display": "explaining elapsed request time",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "When to consider yappi",
      "display": "the attribution clock must be selectable",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need",
      "display": "Separating CPU work from waiting",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Why choose yappi",
      "display": "selectable CPU and wall clocks",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need in introduction",
      "display": "separating CPU work from waiting",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "When to consider line_profiler",
      "display": "individual source lines need investigation",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Developer need",
      "display": "Investigating expensive source lines",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Why choose line_profiler",
      "display": "per-line timing and hit counts",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Developer need in introduction",
      "display": "investigating expensive source lines",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "When to consider scalene",
      "display": "memory-growth attribution is needed",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "Developer need",
      "display": "Locating CPU and memory hotspots",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "Why choose scalene",
      "display": "source-line CPU and memory attribution",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "Developer need in introduction",
      "display": "locating CPU and memory hotspots",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "When to consider pyinstrument",
      "display": "browser-readable sampled call-stack reports are the priority",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "Page introduction",
      "display": "Python profiling libraries let developers measure where application execution time is spent.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: How does sampling differ from tracing function calls?",
      "display": "Pyinstrument samples stacks rather than tracking every function invocation.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: How does sampling differ from tracing function calls?",
      "display": "Yappi is a tracing profiler with thread and coroutine support.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Does Pyinstrument isolate active CPU time?",
      "display": "Tracked durations use wall-clock time and include I/O waiting.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Which clock should count time spent waiting?",
      "display": "Yappi wall-clock timing includes a blocking sleep, while its CPU clock omits that waiting.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Can Yappi separate function statistics by thread?",
      "display": "Filter function statistics using a thread context identifier.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Does stopping Yappi reset the collected results?",
      "display": "Statistics remain in memory until explicitly cleared or the application exits.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Does clearing a Yappi statistics object reset the session?",
      "display": "A statistics object clear affects that object; use yappi.clear_stats for the session.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Does importing the line profiler decorator enable measurement?",
      "display": "The documented decorator example performs no profiling by default.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Is source-line timing reliable for concurrent code?",
      "display": "Threads, processes and async execution can produce unexpected or missing line-profile results.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Does line profiling measure asynchronous GPU execution?",
      "display": "Measurements reflect time spent synchronizing blocking Python calls.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: Which hardware does Scalene GPU-time reporting support?",
      "display": "GPU-time reporting is currently limited to NVIDIA-based systems.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: Does Scalene support memory profiling on Windows?",
      "display": "Current Scalene releases support full Windows memory profiling.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "FAQ: Can Scalene identify time spent waiting at await?",
      "display": "Scalene attributes wall-clock waiting time to the source line where a coroutine is suspended.",
      "asOf": "2026-11-17"
    },
    "F131": {
      "label": "FAQ: How are current Scalene reports collected and viewed?",
      "display": "The run command collects JSON, and view supports browser, terminal and HTML output.",
      "asOf": "2026-11-17"
    },
    "F132": {
      "label": "Library name, py-spy",
      "display": "py-spy",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Monthly downloads, py-spy",
      "display": "21.3M",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "License, py-spy",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Package release, py-spy",
      "display": "0.4.3",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Package release date, py-spy",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Install, py-spy",
      "display": "python -m pip install py-spy==0.4.3",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Quickstart, py-spy",
      "display": "py-spy record -o profile.svg -- python your_script.py\n",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Official description, py-spy",
      "display": "Samples Python programs to profile them.",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Quickstart source file, py-spy",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Repository stars, py-spy",
      "display": "15.7K",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Python API, py-spy",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Execution timing, py-spy",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Memory profiling, py-spy",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Measurement and integration model, py-spy",
      "display": "Out-of-process sampling and native-stack/PID workflows via CLI; no application instrumentation or Python SDK API. Attaching permissions and native-stack platform support apply. A background recorder must be stopped cleanly to finish its output.",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Project function, py-spy",
      "display": "def start_pyspy_trace(dir_path: os.PathLike, blocking: bool = False, rate: int = 100) -> None:\n    with _pyspy_state.lock:\n        if _pyspy_state.process is not None:\n            raise RuntimeError(\"Only one py-spy profile may be run at a time.\")\n\n        timestamp = datetime.now().strftime(\"%Y-%m-%dT%H:%M:%SZ\")\n        pid = os.getpid()\n        output_path = Path(dir_path) / f\"{pid}-{timestamp}.json\"\n        output_path.parent.mkdir(parents=True, exist_ok=True)\n        logger.info(f\"Profiling to {output_path}...\")\n\n        cmd = [\n            \"py-spy\",\n            \"record\",\n            \"--pid\",\n            str(pid),\n            \"--format\",\n            \"speedscope\",\n            \"--nonblocking\" if not blocking else \"--native\",\n            \"--rate\",\n            f\"{rate}\",\n            \"-o\",\n            str(output_path),\n        ]\n\n        env = os.environ.copy()\n        env[\"RUST_LOG\"] = \"warn\"\n\n        process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)\n        _pyspy_state.process = process\n",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Project source file, py-spy",
      "display": "phoenix/xrex/utils/pyspy_profiler.py",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Project full_name, py-spy",
      "display": "xai-org/x-algorithm",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Project stargazers_count, py-spy",
      "display": "34.3K",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Library name, memray",
      "display": "Memray",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Monthly downloads, memray",
      "display": "10.9M",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "License, memray",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Package release, memray",
      "display": "1.20.0",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Package release date, memray",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Install, memray",
      "display": "python -m pip install memray==1.20.0",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Quickstart, memray",
      "display": "import memray\n\nwith memray.Tracker(\"profile.bin\"):\n    values = [i * i for i in range(10000)]\n",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Official description, memray",
      "display": "Profiles memory in Python applications.",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Quickstart source file, memray",
      "display": "docs/api.rst",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Repository stars, memray",
      "display": "15.4K",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Python API, memray",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Execution timing, memray",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Memory profiling, memray",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Measurement and integration model, memray",
      "display": "Tracks Python/interpreter/native allocations and allocation-site stacks; memory rather than CPU-time attribution. Tracker is process-global and cannot nest. Aggregated captures omit event lifetimes/temporary-allocation stats; full-event mode supports different analyses. Captures need a report/viewer step.",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Project function, memray",
      "display": "@contextmanager\ndef memory_reporting() -> Generator[Tuple[Tracker, bool], None, None]:\n    # Restore the original function. This is needed because some\n    # pytest plugins (e.g. flaky) will call our pytest_pyfunc_call\n    # hook again with whatever is here, which will cause the wrapper\n    # to be wrapped again.\n    pyfuncitem.obj = func\n\n    result_file = _build_bin_path()\n    tracker_kwargs = {\n        \"native_traces\": native,\n        \"trace_python_allocators\": trace_python_allocators,\n        \"file_format\": FileFormat.AGGREGATED_ALLOCATIONS,\n    }\n\n    # Add track_object_lifetimes if tracking objects\n    if track_objects:  # pragma: no cover\n        tracker_kwargs[\"track_object_lifetimes\"] = True\n\n    # mypy can't resolve the overload when using **kwargs unpacking\n    tracker = Tracker(result_file, **tracker_kwargs)  # type: ignore[call-overload]\n    yield (tracker, track_objects)\n\n    # Get surviving objects if tracking was enabled\n    surviving_objects = None\n    if track_objects:  # pragma: no cover\n        surviving_objects = list(tracker.get_surviving_objects())\n\n    try:\n        metadata = FileReader(result_file).metadata\n    except OSError:\n        return\n    result = Result(pyfuncitem.nodeid, metadata.peak_memory, result_file)\n\n    with NamedTemporaryFile(\n        dir=self.result_metadata_path,\n        delete=False,\n    ) as tmp_file:\n        tmp_file.write(\n            json.dumps(\n                {\n                    \"test_id\": result.test_id,\n                    \"peak_memory\": result.peak_memory,\n                    \"result_file\": str(result.result_file),\n                }\n            ).encode(\"utf-8\")\n        )\n\n    metadata_filename = result_file.with_suffix(\".metadata\").name\n    os.replace(tmp_file.name, self.result_metadata_path / metadata_filename)\n\n    self.results[pyfuncitem.nodeid] = result\n\n    # Store surviving objects separately (they can't be serialized)\n    if surviving_objects is not None:  # pragma: no cover\n        self.surviving_objects[pyfuncitem.nodeid] = surviving_objects\n",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Project source file, memray",
      "display": "src/pytest_memray/plugin.py",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Project full_name, memray",
      "display": "bloomberg/pytest-memray",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Project stargazers_count, memray",
      "display": "428",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Library name, pyinstrument",
      "display": "Pyinstrument",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Monthly downloads, pyinstrument",
      "display": "9.5M",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "License, pyinstrument",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Package release, pyinstrument",
      "display": "5.1.3",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Package release date, pyinstrument",
      "display": "Jul 2026",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Install, pyinstrument",
      "display": "python -m pip install pyinstrument==5.1.3",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Quickstart, pyinstrument",
      "display": "from pyinstrument import Profiler\nimport time\n\nprofiler = Profiler()\nprofiler.start()\ntime.sleep(0.05)\nprofiler.stop()\nprint(profiler.output_text())\n",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Repository stars, pyinstrument",
      "display": "8.0K",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Python API, pyinstrument",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Execution timing, pyinstrument",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Memory profiling, pyinstrument",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Measurement and integration model, pyinstrument",
      "display": "In-process sampling with readable call-stack/time reports,session combination,and optional async handling. Reports wall time,including waits,not a precise CPU-cycle counter. Each profiler session targets its sampling context/thread rather than automatic whole-host tracing.",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project function, pyinstrument",
      "display": "@contextmanager\ndef instrument(html_output=False):\n    \"\"\"Run a statistical profiler\"\"\"\n    try:\n        from pyinstrument import Profiler  # ty: ignore[unresolved-import]\n    except ImportError:\n        print(\"Failed to run profiler, pyinstrument is not installed\")  # noqa: T201\n        yield\n        return\n\n    profiler = Profiler()\n\n    profiler.start()\n    try:\n        yield\n    finally:\n        profiler.stop()\n\n        if html_output:\n            profiler.open_in_browser()\n        else:\n            print(profiler.output_text(unicode=True, color=True))  # noqa: T201\n",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Project source file, pyinstrument",
      "display": "dvc/_debug.py",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Project full_name, pyinstrument",
      "display": "treeverse/dvc",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Project stargazers_count, pyinstrument",
      "display": "16.0K",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Project function, pyinstrument",
      "display": "def render_pyinstrument(sessions, timeline=False, show_all=False):\n    from pyinstrument.renderers import HTMLRenderer\n    from pyinstrument.session import Session\n    r = HTMLRenderer(timeline=timeline, show_all=show_all)\n    if timeline:\n        session = sessions[-1]\n    else:\n        session = sessions[0]\n        for s in sessions[1:]:\n            session = Session.combine(session, s)\n    try:\n        rendered = r.render(session)\n    except Exception:\n        rendered = \"<h2><b>Rendering pyinstrument session failed</b></h2>\"\n    return escape(rendered), \"\"\n",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Project source file, pyinstrument",
      "display": "panel/io/profile.py",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Project full_name, pyinstrument",
      "display": "holoviz/panel",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Project stargazers_count, pyinstrument",
      "display": "5.8K",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Library name, memory-profiler",
      "display": "memory_profiler",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Monthly downloads, memory-profiler",
      "display": "5.4M",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "License, memory-profiler",
      "display": "BSD",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Package release, memory-profiler",
      "display": "0.61.0",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Package release date, memory-profiler",
      "display": "Nov 2022",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Install, memory-profiler",
      "display": "python -m pip install memory-profiler==0.61.0",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Quickstart, memory-profiler",
      "display": "from memory_profiler import memory_usage\n\nprint(memory_usage(-1, interval=0.1, timeout=0.2))\n",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Official description, memory-profiler",
      "display": "Monitors the memory usage of a Python program.",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Quickstart source file, memory-profiler",
      "display": "memory_profiler.py",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Repository stars, memory-profiler",
      "display": "4.6K",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Python API, memory-profiler",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Execution timing, memory-profiler",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Memory profiling, memory-profiler",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Measurement and integration model, memory-profiler",
      "display": "Line/process memory sampling and callable measurement with RSS or documented alternative backends. RSS includes native memory and shared/process baseline; it is not per-allocation provenance or GPU memory. Latest0.61 release is2022; maintenance and supported host constraints remain visible.",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Project function, memory-profiler",
      "display": "def max_memory(self, dataset, repeat):\n    \"\"\"Compute average max memory consumed by model inference. Units are MiB\"\"\"\n    logger.info(\"Starting memory benchmarking\")\n    total_memory = 0\n    for i, sample in enumerate(dataset):\n        for _r in range(repeat):\n            total_memory += max(memory_usage((self.forward, (sample,), {})))\n        if i % 100 == 0:\n            logger.info(f\"Benchmarked memory for {i}/{len(dataset)} samples\")\n    total_memory = total_memory / (repeat * len(dataset))\n    return total_memory\n",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Project source file, memory-profiler",
      "display": "examples/speech_to_speech/benchmarking/core.py",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Project full_name, memory-profiler",
      "display": "facebookresearch/fairseq",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Project stargazers_count, memory-profiler",
      "display": "32.2K",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Library name, yappi",
      "display": "Yappi",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Monthly downloads, yappi",
      "display": "3.0M",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "License, yappi",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Package release, yappi",
      "display": "1.7.6",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Package release date, yappi",
      "display": "Mar 2026",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Install, yappi",
      "display": "python -m pip install yappi==1.7.6",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Quickstart, yappi",
      "display": "import yappi\n\ndef work():\n    return sum(i * i for i in range(10000))\n\nyappi.start()\nwork()\nyappi.stop()\nyappi.get_func_stats().print_all()\n",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Repository stars, yappi",
      "display": "1.7K",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Python API, yappi",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Execution timing, yappi",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Memory profiling, yappi",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Measurement and integration model, yappi",
      "display": "Deterministic function statistics with CPU/wall clock selection,thread/coroutine profiling,and standard stats export. Global profiler lifecycle and explicit stop/save/clear ownership matter. Internal profiler memory diagnostics are not application allocation profiling.",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Project function, yappi",
      "display": "def stop(self):\n    if not yappi.is_running():\n        raise UsageError(\"CPU profiler is not running\")\n\n    logging.info(\"Stopping CPU profiling\")\n    yappi.stop()\n    stats = yappi.get_func_stats()\n    stats.save(self.filename, self.format)\n    yappi.clear_stats()\n",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Project source file, yappi",
      "display": "lib/vdsm/profiling/cpu.py",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Project full_name, yappi",
      "display": "oVirt/vdsm",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Project stargazers_count, yappi",
      "display": "193",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Library name, line-profiler",
      "display": "line_profiler",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Monthly downloads, line-profiler",
      "display": "2.1M",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "License, line-profiler",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Package release, line-profiler",
      "display": "5.1.0",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Package release date, line-profiler",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Install, line-profiler",
      "display": "python -m pip install line-profiler==5.1.0",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Quickstart, line-profiler",
      "display": "from line_profiler import LineProfiler\n\ndef total():\n    return sum(range(10000))\n\nprofiler = LineProfiler()\nprofiler.add_function(total)\nprofiler.enable()\ntotal()\nprofiler.disable()\nprofiler.print_stats()\n",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Official description, line-profiler",
      "display": "Profiles code line by line.",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Quickstart source file, line-profiler",
      "display": "line_profiler/line_profiler.py",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Repository stars, line-profiler",
      "display": "3.3K",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Python API, line-profiler",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Execution timing, line-profiler",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Memory profiling, line-profiler",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Measurement and integration model, line-profiler",
      "display": "Instrumented per-line timing of registered Python callables,with a Python API and kernprof workflows. Python callable source/registration matters; C/native work inside a line is charged to that line,not decomposed into native-function allocation stacks.",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Project function, line-profiler",
      "display": "def profile_on(fcn_names=None):\n    if fcn_names and HAS_LINE_PROFILER:\n        pr = LineProfiler()\n        for fcn_name in fcn_names:\n            pr.add_function(fcn_name)\n        pr.enable()\n        return pr\n\n    pr = cProfile.Profile()\n    pr.enable()\n    return pr\n",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Project source file, line-profiler",
      "display": "pylib/cqlshlib/util.py",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Project full_name, line-profiler",
      "display": "apache/cassandra",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Project stargazers_count, line-profiler",
      "display": "10.2K",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Library name, viztracer",
      "display": "VizTracer",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Monthly downloads, viztracer",
      "display": "1.5M",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "License, viztracer",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Package release, viztracer",
      "display": "1.1.1",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Package release date, viztracer",
      "display": "Nov 2025",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Install, viztracer",
      "display": "python -m pip install viztracer==1.1.1",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Quickstart, viztracer",
      "display": "from viztracer import VizTracer\n\ndef work():\n    return sum(range(10000))\n\nwith VizTracer(output_file=\"trace.json\"):\n    work()\n",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Official description, viztracer",
      "display": "Traces and visualizes Python code execution.",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Quickstart source file, viztracer",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Repository stars, viztracer",
      "display": "7.8K",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Python API, viztracer",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Execution timing, viztracer",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Memory profiling, viztracer",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Measurement and integration model, viztracer",
      "display": "Function-entry/exit timeline tracing,thread/async/GC events,and saved JSON reports. Event tracing differs from sampling and can produce large buffers/files. GC event logging and argument reprs are not application memory-size attribution; separate plugins can add other measurements.",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Project function, viztracer",
      "display": "@classmethod\ndef _run_server(cls, registry, address, authkey, serializer, writer, initializer=None, initargs=()):\n    PR_SET_PDEATHSIG = 1  # noqa\n    libc = ctypes.CDLL(ctypes.util.find_library(\"c\"), use_errno=True)\n    libc.prctl(PR_SET_PDEATHSIG, signal.SIGTERM)  # terminate process when parent **thread** dies\n\n    if bool(os.environ.get(\"PYTRITON_VIZTRACER\")):\n        from viztracer import VizTracer  # type: ignore # pytype: disable=import-error\n\n        cls._tracer = VizTracer(log_async=True, log_gc=True, tracer_entries=10000000, pid_suffix=True)\n        cls._tracer.register_exit()\n        cls._tracer.start()\n\n    super()._run_server(\n        registry, address, authkey, serializer, writer, initializer, initargs\n    )  # pytype: disable=attribute-error\n",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Project source file, viztracer",
      "display": "pytriton/proxy/data.py",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Project full_name, viztracer",
      "display": "triton-inference-server/pytriton",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Project stargazers_count, viztracer",
      "display": "849",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Library name, scalene",
      "display": "Scalene",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Monthly downloads, scalene",
      "display": "293.0K",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "License, scalene",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Package release, scalene",
      "display": "2.4.0",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "Package release date, scalene",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "Install, scalene",
      "display": "python -m pip install scalene==2.4.0",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "Quickstart, scalene",
      "display": "scalene run your_script.py\n",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "Repository stars, scalene",
      "display": "13.6K",
      "asOf": "2026-11-20"
    },
    "F266": {
      "label": "Python API, scalene",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F267": {
      "label": "Execution timing, scalene",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F268": {
      "label": "Memory profiling, scalene",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F269": {
      "label": "Measurement and integration model, scalene",
      "display": "Samples and attributes CPU,Python/native execution,memory,and GPU-related activity with platform-specific support. Current2.4 CLI splits run from view; the former script-only invocation is rejected. Embedded start/stop controls require Scalene’s launcher setup,not arbitrary normal-Python initialization. AI optimization is optional and separate from profiling.",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python profiling libraries Pyinstrument Yappi line_profiler Scalene code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
