Skip to content

psm: speedup#10080

Merged
maliberty merged 6 commits intoThe-OpenROAD-Project:masterfrom
gadfort:speedup1
Apr 10, 2026
Merged

psm: speedup#10080
maliberty merged 6 commits intoThe-OpenROAD-Project:masterfrom
gadfort:speedup1

Conversation

@gadfort
Copy link
Copy Markdown
Collaborator

@gadfort gadfort commented Apr 7, 2026

Summary

No functional changes, just improving the runtime of PSM.
On "large" design, check_power_grid goes from 2400s to 1800s with these changes.
There are more improvements possible, but decided this was a good checkpoint to save at.

Type of Change

  • Refactoring

Impact

Speed up

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

Related Issues

N/A

gadfort added 4 commits April 7, 2026 18:44
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
@gadfort gadfort requested a review from maliberty April 7, 2026 23:41
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the node and connection comparison logic from a tuple-based approach to an explicit integer-based comparison returning -1, 0, or 1. It also optimizes the 'visited' state tracking during network traversal by moving the state into the Node class itself, replacing an external std::set. A logic error was identified in the Connection::compare function where null handling was inconsistent with the rest of the comparison logic, potentially violating strict weak ordering.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Signed-off-by: Peter Gadfort <peter.gadfort@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

clang-tidy review says "All clean, LGTM! 👍"

Comment on lines +56 to +57
int compare(const Node* other) const;
int compare(const std::unique_ptr<Node>& other) const;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably this should be operator<=> but that can wait for another PR

@maliberty maliberty merged commit e1ccc99 into The-OpenROAD-Project:master Apr 10, 2026
15 checks passed
@gadfort gadfort deleted the speedup1 branch April 10, 2026 11:56
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