joerick/pyinstrument — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a Python tool that helps me figure out why my code is slow. I want to run it from the terminal against a script, or wrap a small part of my code with a simple context manager or decorator, then get a clear report that shows where the time went in the call stack. The terminal output should be readable for humans and focus attention on the slowest functions instead of dumping noise.

Also make an HTML report that I can open in a browser, with an interactive call tree and timeline so I can click around, expand and collapse rows, and see library code separately from my own code. Include a clean Python API for starting and stopping a profile, saving results, and customizing the description shown in the report. Please include examples for normal scripts, async code, Django style middleware, and notebooks if practical. Package it so it can be installed with pip and works on modern Python. Look up current docs online if you need to.

Want more depth? Deep Reverse