Per @jph00 would be nice for a built-in FastHTML control that does this and requires behavioural change of library:
app = fast_app()
app.add_instrument() # Adds Profile middleware to app, or raises import error if fh-pyinstrument not installed
@rt
@instrument # Only works if app.add_instrument called
def index(): return Titled('Hello')
Per @jph00 would be nice for a built-in FastHTML control that does this and requires behavioural change of library: