% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/benchmark_branches.R
\name{benchmark_branches}
\alias{benchmark_branches}
\title{Branch-Based Performance Benchmarker}
\usage{
benchmark_branches()
}
\value{
A data frame containing the benchmark results, including the branch name, 
execution time in seconds, and the execution status (Success/Failed).
}
\description{
Interactively selects Git branches, runs a target R script in an isolated environment 
for each branch, and compares the execution times to identify performance regressions 
or improvements across different versions of the codebase.
}
\details{
The function performs the following workflow:

\itemize{
  \item Verifies that the current directory is a Git repository.
  \item Extracts available branches and allows the user to select specific ones or benchmark all.
  \item Prompts for the path to the R script to be benchmarked.
  \item Stashes any uncommitted changes to ensure a clean state.
  \item Iterates through the selected branches, checking each one out and executing 
      the target script within a fresh environment \code{new.env()}.
  \item Restores the original branch and pops the stash to return the workspace to its initial state.
}
}
\section{Warning}{

This function modifies files on disk or the global environment. Please ensure you have a backup or are using version control (e.g., Git) before execution.
}

\examples{
if (interactive()) {
  benchmark_branches()
}
}
