⚡ Bolt: [performance improvement] Optimize dictionary lookup in _add_phase_tracking_costs - #309
⚡ Bolt: [performance improvement] Optimize dictionary lookup in _add_phase_tracking_costs#309dieterolson wants to merge 3 commits into
Conversation
Co-authored-by: dieterolson <198168927+dieterolson@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. |
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>
|
Closing in favor of consolidated batch PR #311. |
Pull request was closed
💡 What: Replaced a double dictionary lookup (
if key in dict: val = dict[key]) with a singleget()call (val = dict.get(key)) in the_add_phase_tracking_costshot 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