⚡ Bolt: [performance improvement] Avoid list materialization in AST traversals - #172
⚡ Bolt: [performance improvement] Avoid list materialization in AST traversals#172tachyon-beep wants to merge 1 commit into
Conversation
…raversals Co-authored-by: tachyon-beep <544926+tachyon-beep@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Pull request overview
This PR targets a small performance win in the L2 taint analyzer by removing unnecessary list(...) materialization during AST traversal, allowing traversal helpers to consume generators/iterables directly.
Changes:
- Update
_assignment_calleeand_collect_return_pathsto acceptIterable[ast.AST]and passast.iter_child_nodes(...)directly. - Avoid copying
func_node.bodywithlist(...)at call sites. - Add a short “bolt” note documenting the generator-preservation practice (plus minor formatting-only changes in a few tests / one server line wrap).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/mcp/test_server_trust_grants.py | Formatting-only change to a write_text(...) call. |
| tests/unit/install/test_mcp_json.py | Formatting-only changes (line wrapping / signature layout). |
| tests/unit/install/test_doctor_pack_grants.py | Formatting-only change (signature layout). |
| src/wardline/scanner/taint/variable_level.py | Core change: accept Iterable and stop materializing AST child iterators/lists during traversal. |
| src/wardline/mcp/server.py | Formatting-only change (single-line expression). |
| src/wardline/install/block.py | Add blank lines (formatting-only). |
| bolt_plan.txt | Add Bolt plan documenting intended work. |
| .jules/bolt.md | Add short learning note about avoiding list materialization in AST traversals. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
💡 What: Updated
_assignment_calleeand_collect_return_pathsto acceptIterable[ast.AST]instead oflist[ast.AST], passing generators likeast.iter_child_nodes()directly.🎯 Why: To prevent unnecessary intermediate list memory allocations during deep or frequent AST traversals.
📊 Impact: Reduces memory usage and improves speed of L2 taint analysis by avoiding redundant list allocations for every AST node visited.
🔬 Measurement: Run the test suite and observe no functional regressions with potentially improved memory profile during large static analysis runs.
PR created automatically by Jules for task 7975574428086653022 started by @tachyon-beep