r-performance

Profile and benchmark R code to identify bottlenecks and optimize implementations.

1|1|Updated May 5, 2026
One-click install
npx skills add https://github.com/cynkra/cynkra.ai.day --skill r-performance-cynkra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-performance
Source: https://github.com/cynkra/cynkra.ai.day/tree/main/claude-code-r-skills/.claude/skills/r-performance
Command: npx skills add https://github.com/cynkra/cynkra.ai.day --skill r-performance-cynkra

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you identify real performance bottlenecks in R and choose the right optimization techniques without guessing or prematurely rewriting code.

Core Features & Use Cases

  • Profiling-first workflow: Use profvis and benchmark runs to locate where time is actually spent and to validate improvements.
  • Benchmark-driven comparison: Use bench::mark() to compare multiple implementations and understand runtime and memory trade-offs.
  • Optimization strategies for hot spots: Apply vctrs for type stability and consistent coercion, and select appropriate data backends (base R, dplyr, data.table) based on dataset size and needs.
  • Parallelization guidance: Use parallel patterns carefully to avoid overhead and memory issues.

Quick Start

Use r-performance to diagnose and improve the speed of your R workflow by asking your AI to profile your current function, benchmark alternatives for the slowest parts, and recommend targeted changes using vctrs and the right data backend.

Frequently Asked Questions about r-performance

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

FAQPage Schema
How do I find bottlenecks in my R code?

Benchmark R performance by using bench::mark() to compare multiple implementations and understand runtime and memory trade-offs. This validates improvements and helps select effective acceleration techniques for slow data transformations.

When should I use data.table instead of dplyr for performance?

Choose data.table over dplyr based on dataset size and specific transformation needs. Use benchmark-driven comparison to evaluate runtime and memory trade-offs, selecting the appropriate data backend only after measuring actual performance differences.

How do I speed up slow data transformations in R?

Speed up R data transformations by profiling to identify true bottlenecks, then applying targeted changes like vctrs for type stability and consistent coercion. Select effective acceleration techniques without premature optimization by validating improvements with benchmarks.

Can I use parallel processing to optimize R code?

You can use parallel processing in R, but apply parallel patterns carefully to avoid overhead and memory issues. Profile first to confirm parallelization benefits outweigh its costs, selecting it only for validated hot spots.

What is vctrs used for in R performance optimization?

vctrs is used in R performance optimization to ensure type stability and consistent coercion during data transformations. Apply it to hot spots identified by profiling to prevent performance degradation from type mismatches.