Skip to content

⚡ Bolt: [performance improvement] Optimize dictionary lookup in _add_phase_tracking_costs - #309

Closed
dieterolson wants to merge 3 commits into
mainfrom
bolt/opt-dict-lookup-5839190333747016691
Closed

⚡ Bolt: [performance improvement] Optimize dictionary lookup in _add_phase_tracking_costs#309
dieterolson wants to merge 3 commits into
mainfrom
bolt/opt-dict-lookup-5839190333747016691

Conversation

@dieterolson

Copy link
Copy Markdown
Contributor

💡 What: Replaced a double dictionary lookup (if key in dict: val = dict[key]) with a single get() call (val = dict.get(key)) in the _add_phase_tracking_costs hot loop.
🎯 Why: To reduce unnecessary hash map lookups during trajectory optimization setup, adhering to Python best practices for O(1) lookups in tight loops.
📊 Impact: Micro-optimization. Reduces the overhead of setting up phase tracking costs in Drake's MathematicalProgram.
🔬 Measurement: Verified that tests and benchmarks continue to pass successfully.


PR created automatically by Jules for task 5839190333747016691 started by @dieterolson

Co-authored-by: dieterolson <198168927+dieterolson@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.

google-labs-jules Bot and others added 2 commits August 7, 2026 09:21
Update actions/checkout from v7 (which doesn't exist) to v4 across all GitHub Actions workflows to fix the CI failure.

Co-authored-by: dieterolson <198168927+dieterolson@users.noreply.github.com>
Update actions/checkout from v7 (which doesn't exist) to v4 across all GitHub Actions workflows to fix the CI failure. Also install `coverage` to resolve a missing dependency error in `pytest-cov`.

Co-authored-by: dieterolson <198168927+dieterolson@users.noreply.github.com>
@dieterolson

Copy link
Copy Markdown
Contributor Author

Closing in favor of consolidated batch PR #311.

auto-merge was automatically disabled August 11, 2026 05:38

Pull request was closed

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