with one click
benchmark-rbs
// Benchmark Rubydex indexing performance on RBS core/stdlib, comparing the current branch against main. Measures maximum RSS and execution time.
// Benchmark Rubydex indexing performance on RBS core/stdlib, comparing the current branch against main. Measures maximum RSS and execution time.
Profile Rubydex indexer performance — CPU flamegraphs, memory usage, phase-level timing. Use this skill whenever the user mentions profiling, performance, flamegraphs, benchmarking, "why is X slow", bottlenecks, hot paths, memory usage, or wants to understand where time is spent during indexing/resolution. Also trigger when comparing performance before/after a change.
Reviews code changes for Rubydex
Use when benchmarking rubydex MCP against plain Grep/Glob for Ruby code tasks. Guides A/B comparison setup, candidate selection, and metrics collection.
| name | benchmark-rbs |
| description | Benchmark Rubydex indexing performance on RBS core/stdlib, comparing the current branch against main. Measures maximum RSS and execution time. |
Compare Rubydex indexing performance between main and the current topic branch using
the RBS core and stdlib directories.
Clone the https://github.com/ruby/rbs.git repository under the repository root and use
the following paths as benchmark targets:
tmp/rbs/coretmp/rbs/stdlibThe tmp/ directory is at the rubydex repository root. Create it if it doesn't exist.
Before building, record the current branch name and commit SHA, and the main branch SHA.
These will be used in the results table, e.g. main (abc1234) and my-branch (def5678).
TOPIC_BRANCH=$(git branch --show-current)
TOPIC_SHA=$(git rev-parse --short HEAD)
MAIN_SHA=$(git rev-parse --short main)
Also record the RBS repository branch and SHA after cloning:
RBS_BRANCH=$(git -C tmp/rbs branch --show-current)
RBS_SHA=$(git -C tmp/rbs rev-parse --short HEAD)
Print the RBS version in the results, e.g. rbs: master (abc1234).
cargo build --release
cp rust/target/release/rubydex_cli tmp/rubydex_cli_branch
git stash
git checkout main
cargo build --release
cp rust/target/release/rubydex_cli tmp/rubydex_cli_main
git checkout -
git stash pop
Run each binary 3 times and take the median. Use utils/mem-use for memory and time
measurement. Pass both core and stdlib together as a single benchmark run.
# Main
utils/mem-use tmp/rubydex_cli_main tmp/rbs/core tmp/rbs/stdlib --stats
# Branch
utils/mem-use tmp/rubydex_cli_branch tmp/rbs/core tmp/rbs/stdlib --stats
Present a table comparing:
| Branch | Max RSS (MB) | Indexing (s) | Resolution (s) |
|---|---|---|---|
| main (MAIN_SHA) | ... | ... | ... |
| TOPIC_BRANCH (TOPIC_SHA) | ... | ... | ... |
Include the delta (absolute and %) for RSS and each time metric.
/usr/bin/time -l.--stats flag's internal timer.--stats flag's internal timer.