r-benchmarking

Benchmark R code performance with timings, microbenchmarks, and profiling.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/jjjermiah/dot-agents --skill r-benchmarking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-benchmarking
Source: https://github.com/jjjermiah/dot-agents/tree/main/src/dot-agents/skills/r-benchmarking
Command: npx skills add https://github.com/jjjermiah/dot-agents --skill r-benchmarking

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Benchmark reproducible performance of R code across macro timing, microbenchmarks, and profiling.

Core Features & Use Cases

  • Macro timing: end-to-end timing using system.time or proc.time to quantify total runtime.
  • Microbenchmarks: precise comparisons with bench::mark and bench::press for parameter grids.
  • Profiling hotspots: identify bottlenecks with Rprof/summaryRprof and profvis for interactive exploration.
  • Reproducibility: enforce warmups, seeds, and environment details to ensure stable comparisons.
  • Use Case: compare two implementations of a function to decide which to adopt based on speed and memory.

Quick Start

Run a quick reproducible benchmark on your R code to identify performance hotspots.

Frequently Asked Questions about r-benchmarking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I benchmark R code for reproducible performance measurements?

Benchmark R code by applying warmups, seeds, and environment details to ensure stable comparisons. Use macro timing with system.time, microbenchmarks with bench::mark, and profiling with Rprof to quantify runtime and identify bottlenecks.

What is the best way to profile R scripts and find performance hotspots?

Profile R scripts using Rprof and summaryRprof to identify bottlenecks, or use profvis for interactive exploration. This pinpoints performance hotspots by providing detailed timing and allocation summaries of your functions.

How do I compare two R function implementations based on speed and memory?

Compare R function implementations using bench::mark for precise speed and memory evaluations. It provides repeatable workflows with warmups and seeds, delivering interpretable outputs including timings and allocations to decide which to adopt.

When should I use microbenchmark instead of system.time for R code timing?

Use system.time for macro timing to quantify total end-to-end runtime, but switch to microbenchmark or bench::mark when you need precise, repeatable comparisons across multiple iterations with detailed allocation tracking.

Can I run R benchmarks across parameter grids to test different inputs?

Yes, you can run R benchmarks across parameter grids using bench::press. This enables reproducible microbenchmark comparisons by evaluating your R functions against multiple input combinations while maintaining stable test conditions.

Does reproducible R benchmarking require environment details and seeds?

Reproducible R benchmarking requires enforcing warmups, seeds, and environment details to ensure stable comparisons. This prevents timing fluctuations and memory allocation variances from skewing your performance measurements.