Skip to content

⚡ Bolt: [performance improvement] Avoid list materialization in AST traversals - #172

Open
tachyon-beep wants to merge 1 commit into
mainfrom
jules-bolt-perf-ast-traversal-7975574428086653022
Open

⚡ Bolt: [performance improvement] Avoid list materialization in AST traversals#172
tachyon-beep wants to merge 1 commit into
mainfrom
jules-bolt-perf-ast-traversal-7975574428086653022

Conversation

@tachyon-beep

Copy link
Copy Markdown
Collaborator

💡 What: Updated _assignment_callee and _collect_return_paths to accept Iterable[ast.AST] instead of list[ast.AST], passing generators like ast.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

…raversals

Co-authored-by: tachyon-beep <544926+tachyon-beep@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings August 29, 2026 16:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T16:33:22.305323Z 45441eb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_callee and _collect_return_paths to accept Iterable[ast.AST] and pass ast.iter_child_nodes(...) directly.
  • Avoid copying func_node.body with list(...) 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.

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.

2 participants