Repository navigation
Avoid quadratic C header evidence scans - #1099
Open
Ha1baraA11 wants to merge 1 commit into
Open
Ha1baraA11 wants to merge 1 commit into
Ha1baraA11 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Linked issue
Fixes #977
What & why
_is_in_static_dead_guard()for every syntaxnode. On long nested
#elifchains, each call rescanned ancestors. This PRcarries dead-branch state through one top-down scan and makes other guard
checks inspect each parent-child edge once, preserving
if falseand#if 0behavior.
CodeParser.parse_bytestime fellfrom 108.417 seconds (baseline) to 0.231 seconds (patch) on macOS 15.8
arm64/Python 3.13.9. This timing does not cover a full CLI build.
How it was tested
uv run pytest tests/ --tb=short -q— 4269 passed, 850 skipped, 2 xfailed,2 xpassed; one Starlette deprecation warning. A temporary 20 ms
PollingObservershim avoided an unrelated macOS FSEvents crash; no projectfile was changed for the shim.
uv run ruff check code_review_graph/— passed.uv run ruff check code_review_graph/ tests/test_cpp_qt_headers.py— passed.uv run pytest tests/test_cpp_qt_headers.py --tb=short -q— 15 passed.uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optionalreported one type error at
code_review_graph/embeddings.py:253, outside thisPR's changed files.
Checklist
uv run pytest tests/ --tb=short -quv run ruff check code_review_graph/uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optionaldocs/, docstrings)