Repository navigation
Allow indexing without method references - #1062
Closed
rafaelfranca wants to merge 2 commits into
Closed
rafaelfranca wants to merge 2 commits into
rafaelfranca wants to merge 2 commits into
Conversation
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>
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
The reduced mode avoids method-reference allocations. These data do not assign the 0.72-second wall difference to the option alone. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_graphand both backend constructors keeptrueas 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 infa97b0c2. 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 existinggraph_memorybenchmark required its workspace argument. The benchmark asks forutils/bench-graph-memoryinstead. 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.constant_graphprojection 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.<CallOnly>name from a focused file./usr/bin/time -lpairs 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.