% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare.R
\name{pv_compare}
\alias{pv_compare}
\title{Compare two profvis profiles}
\usage{
pv_compare(before, after, n = 20)
}
\arguments{
\item{before}{A profvis object (before optimization).}

\item{after}{A profvis object (after optimization).}

\item{n}{Number of top functions to compare.}
}
\value{
A list with:
\itemize{
\item \code{summary}: Overall comparison summary
\item \code{by_function}: Function-by-function comparison
\item \code{improved}: Functions that got faster
\item \code{regressed}: Functions that got slower
}
}
\description{
Compares two profiling runs to show what changed. Useful for measuring
the impact of optimizations.
}
\examples{
p1 <- pv_example()
p2 <- pv_example()
pv_compare(p1, p2)
}
