Skip to content

Cache RBS core index in indexer test setup#3944

Merged
st0012 merged 1 commit intomainfrom
cache-rbs-core-index
Feb 6, 2026
Merged

Cache RBS core index in indexer test setup#3944
st0012 merged 1 commit intomainfrom
cache-rbs-core-index

Conversation

@st0012
Copy link
Member

@st0012 st0012 commented Feb 6, 2026

Summary

  • Cache the RBSIndexer#index_ruby_core result using Marshal.dump/Marshal.load in RubyIndexer::TestCase#setup, so it's built once per test class instead of once per test method
  • Previously, every indexer test method (~264 across 9 test classes) rebuilt the entire Ruby core type index from scratch, adding ~2 minutes of pure setup overhead

Benchmarks

Local (bundle exec rake test:indexer, Apple Silicon, Ruby 3.4.7, 3 runs each):

Run 1 Run 2 Run 3 Avg
Before 166.1s 124.3s 111.5s 133.9s
After 21.8s 21.5s 23.2s 22.1s

@st0012 st0012 force-pushed the cache-rbs-core-index branch from c37841c to dfda06a Compare February 6, 2026 20:28
@st0012 st0012 added the chore Chore task label Feb 6, 2026
@st0012 st0012 changed the title Cache RBS's Ruby core index between test runs Cache RBS core index in indexer test setup Feb 6, 2026
@st0012 st0012 marked this pull request as ready for review February 6, 2026 21:52
@st0012 st0012 requested a review from a team as a code owner February 6, 2026 21:52
@st0012 st0012 self-assigned this Feb 6, 2026
@st0012 st0012 merged commit 2a59d3e into main Feb 6, 2026
39 of 40 checks passed
@st0012 st0012 deleted the cache-rbs-core-index branch February 6, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Chore task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants