Skip to content

Allow indexing without method references - #1062

Closed
rafaelfranca wants to merge 2 commits into
mainfrom
roundhouse-index/method-references
Closed

rafaelfranca wants to merge 2 commits into
mainfrom
roundhouse-index/method-references

Conversation

@rafaelfranca

@rafaelfranca rafaelfranca commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Why

Roundhouse PR #279 builds full Ruby graphs for constant resolution. Roundhouse then discards method references and synthetic receiver references. A filter on a completed graph cannot prevent the allocation of these entries or their interned data.

Change

IndexingOptions { collect_method_references: false } stops reference construction in both Ruby backends. build_local_graph and both backend constructors keep true as the default. The reduced mode keeps written constant references, definitions, lexical scopes, diagnostics, and source offsets. RBS keeps its existing behavior because RBS has no method-call references. A namespace can lose a promotion that only an omitted method call caused.

Evidence

  • cargo test --manifest-path rust/Cargo.toml -p rubydex --lib without_method_references_tests: 12 tests passed across both Ruby backends.
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets --all-features -- -D warnings: passed after the CI lint repair in fa97b0c2. Both CI lint jobs passed on that commit.
  • cargo test --manifest-path rust/Cargo.toml -p rubydex --all-targets: 1,166 library tests and nine CLI tests passed. The command failed when the existing graph_memory benchmark required its workspace argument. The benchmark asks for utils/bench-graph-memory instead. This PR is a draft because the requested command failed.
  • cargo build --release --manifest-path /tmp/rubydex-method-references.Mz98GI/Cargo.toml: passed for the temporary consumer. An unknown mode returned status 2.
  • The temporary consumer used Roundhouse's current constant_graph projection for both modes. Its written constant answers matched in ten measured pairs. Each run had 29 answers from six focused files and 200,000 answers from the synthetic corpus.
  • The corpus had 1,000 Ruby files and 100,000 calls. Before projection, legacy graphs had 2,999 names, 5,999 strings, 300,000 constant references, 100,000 method references, and 100,000 attached references. Reduced graphs had 1,999 names, 3,999 strings, 200,000 constant references, no method references, and no attached references. The reduced mode also omitted the call-only <CallOnly> name from a focused file.
  • Ten /usr/bin/time -l pairs gave median elapsed times of 1.375 seconds for legacy and 1.360 seconds for reduced. The median peak RSS values were 55,975,936 bytes and 55,762,944 bytes. The median index times were 1,256.195 ms and 1,239.030 ms. The median resolution times were 17.511 ms and 17.301 ms.
  • This test uses public synthetic input, not the Roundhouse application. The process time includes start time and answer output. Time and RSS ranges overlap across modes. These data do not establish a speed increase.

rafaelfranca and others added 2 commits October 1, 2026 18:00
Roundhouse constructs method references and synthetic receiver data, then discards them before constant resolution. This option omits that work before allocation and keeps written constant targets.

Co-Authored-By: OpenAI <noreply@openai.com>
Use if let for the alias receiver. Convert test offsets without truncation.

Co-Authored-By: OpenAI <noreply@openai.com>
@rafaelfranca

Copy link
Copy Markdown
Member Author

This experiment does not justify a public option and changes to both Ruby visitors.

Roundhouse PR #279 used 6,358 Ruby files in 16 alternating release pairs at Rubydex 664ac555.

  • Median wall times were 22.55 seconds for default and 21.83 seconds for reduced. Reduced was faster in 14 pairs.
  • Median Rubydex index times were 0.125 and 0.110 seconds.
  • Median peak RSS values were 2057.31 and 2040.00 MB. Reduced used less RSS in eight pairs, so the full-process benefit was not consistent.
  • Diagnostic hashes and all 716 error counts matched.
  • The synthetic 100,000-call test gave median times of 1.375 and 1.360 seconds. Median RSS values were 55.98 and 55.76 MB. Its ranges overlapped.

The reduced mode avoids method-reference allocations. These data do not assign the 0.72-second wall difference to the option alone.

@rafaelfranca
rafaelfranca deleted the roundhouse-index/method-references branch October 1, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant