r-performance

Profile and benchmark R code using profvis, bench, and Rprof.

189|26|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/ab604/claude-code-r-skills --skill r-performance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-performance
Source: https://github.com/ab604/claude-code-r-skills/tree/main/.claude/skills/r-performance
Command: npx skills add https://github.com/ab604/claude-code-r-skills --skill r-performance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps data scientists and developers quickly identify bottlenecks in R code, reduce runtime, and implement reliable optimization strategies for performance-critical workflows.

Core Features & Use Cases

  • Profiling workflow: Use profvis, Rprof, and system.time to locate hot spots in complex scripts.
  • Benchmarking & comparison: Use bench::mark() to compare alternatives and quantify improvements.
  • Guidance on vctrs: Decide when type-stable, vectorized approaches are advantageous for packages and data pipelines.
  • Use Case: Example scenario where a data analysis pipeline with large data frames benefits from profiling and targeted optimizations.

Quick Start

Use profvis({ your_slow_function(data) }) to identify the slow parts, then benchmark alternatives with bench::mark() and implement the fastest approach in your code.

Frequently Asked Questions about r-performance

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

FAQPage Schema
How do I profile R code to find slow functions and memory bottlenecks?

Profile R code by wrapping functions in profvis() or using Rprof and system.time to locate runtime hot spots and memory bottlenecks in complex data analysis scripts. This identifies exactly which lines need optimization.

What is the best way to benchmark and compare R code performance?

Benchmark R code performance using bench::mark() to compare alternative implementations and quantify timing improvements. This provides measurable observations to select the fastest approach for your data pipelines.

When should I use vctrs for performance tuning in R packages?

Use vctrs for performance tuning in R packages when you need type-stable, vectorized approaches to accelerate data pipelines. It is advantageous for optimizing package code where predictable output types and speed matter.

Does this R optimization workflow apply to large data frames and reproducible scripts?

Yes, this R optimization workflow applies to large data frames, packages, and reproducible scripts. It guides tool selection and workflow steps to achieve measurable performance improvements in data analysis pipelines.

How do I start optimizing a slow R data analysis pipeline?

Start optimizing a slow R data analysis pipeline by running profvis({ your_slow_function(data) }) to identify slow parts, then benchmark alternatives with bench::mark() and implement the fastest approach in your code.