performance
Installation
SKILL.md
Ruby Performance Optimization
Guide to profiling, benchmarking, and optimizing Ruby code.
Profiling First
Always measure before optimizing. Identify bottlenecks with profiling tools.
benchmark-ips
Compare implementations with statistical significance:
require "benchmark/ips"
Benchmark.ips do |x|
x.report("map + flatten") do
[[1, 2], [3, 4]].map { |a| a * 2 }.flatten
end