r-performance

Profile and benchmark R code to identify performance bottlenecks.

1|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/gnoblet/ANA_app_svelte --skill r-performance-gnoblet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-performance
Source: https://github.com/gnoblet/ANA_app_svelte/tree/main/.claude/.claude/skills/r-performance
Command: npx skills add https://github.com/gnoblet/ANA_app_svelte --skill r-performance-gnoblet

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

R performance optimization, profiling, benchmarking, and safe vectorization strategies to improve speed and reduce memory usage in data analysis and packaging workflows.

Core Features & Use Cases

  • Profiling guidance with tools like profvis, Rprof, bench, and system.time to locate bottlenecks.
  • Vectorization and vctrs-based strategies to ensure type-safe, fast operations.
  • Use Case: Optimizing a lengthy data-cleaning pipeline or a simulation model in an R package.

Quick Start

Run profiling on a representative R script to identify bottlenecks and apply recommended optimizations.

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 slow R code?

Benchmark R code performance using the bench package to compare execution times and memory allocation across different implementations, ensuring type-safe vectorization with vctrs for accurate, reproducible results.

What is the best way to vectorize R code for faster execution?

The best way to vectorize R code for faster execution is using vctrs-based strategies to ensure type-safe, fast operations, replacing slow loops with optimized backend choices and structured guidance.

Can I use profvis to profile a lengthy data-cleaning pipeline in R?

Yes, you can use profvis to profile a lengthy data-cleaning pipeline in R. It helps locate performance bottlenecks by tracking execution time and memory usage across your workflow.

How do I reduce memory usage in an R package simulation model?

Reduce memory usage in an R package simulation model by profiling bottlenecks with system.time or Rprof, then applying safe vectorization strategies and optimizing backend choices to minimize memory overhead.

Why does my R code run slowly and how can I optimize it?

Your R code may run slowly due to unoptimized loops or inefficient memory usage. Identify bottlenecks using profiling tools like profvis, then optimize performance with bench, vctrs, and vectorization techniques.

What are the limitations of using system.time for R performance profiling?

The limitation of using system.time for R performance profiling is that it only provides overall elapsed time, lacking the detailed line-by-line bottleneck identification that profvis or Rprof offer for complex optimization.