% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/recursive.R
\name{pv_recursive}
\alias{pv_recursive}
\title{Detect recursive functions}
\usage{
pv_recursive(x)
}
\arguments{
\item{x}{A profvis object.}
}
\value{
A data frame with columns:
\itemize{
\item \code{label}: Function name
\item \code{max_depth}: Maximum recursion depth observed
\item \code{avg_depth}: Average recursion depth when recursive
\item \code{recursive_samples}: Number of samples where function appears multiple times
\item \code{total_samples}: Total samples where function appears
\item \code{pct_recursive}: Percentage of appearances that are recursive
\item \code{total_ms}: Total time on call stack
\item \code{pct_time}: Percentage of total profile time
}
}
\description{
Identifies functions that call themselves (directly recursive) or appear
multiple times in the same call stack. Recursive functions in hot paths
are often optimization targets.
}
\examples{
p <- pv_example("recursive")
pv_recursive(p)
}
