Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Use circuit name hashCode for circuit anno hashCode #2504

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

jackkoenig
Copy link
Contributor

It is unclear if having more than one circuit annotation even works. If
it does, it is implausible that they would have the same circuit name
since that would correspond to a namespace collision.

Looking at flamegraphs, FirrtlCircuitAnnotation.hashCode always comes up. Creating a HashMap with different Circuits that nevertheless have the same name is extremely uncommon so collisions are not a concern. Include productPrefix so that this doesn't collide with other types that use a similar strategy and hash the same String.

This speeds up anything using Stage/Phase with FIRRTL Circuits which includes Chisel

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • [NA] Did you update the FIRRTL spec to include every new feature/behavior?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • performance improvement

API Impact

No impact

Backend Code Generation Impact

No impact

Desired Merge Strategy

  • Squash

Release Notes

Improve performance of FirrtlCircuitAnnotation.hashCode. This speeds up all uses of Stage/Phase.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (1.2.x, 1.3.0, 1.4.0) ?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

It is unclear if having more than one circuit annotation even works. If
it does, it is implausible that they would have the same circuit name
since that would correspond to a namespace collision.
@jackkoenig jackkoenig added this to the 1.5.x milestone Apr 5, 2022
Copy link
Contributor

@ekiwi ekiwi left a comment

Choose a reason for hiding this comment

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

Seems reasonable 🚢

@jackkoenig jackkoenig merged commit aea60aa into master Apr 5, 2022
@jackkoenig jackkoenig deleted the cheaper-circuit-anno-hashcode branch April 5, 2022 16:17
mergify bot pushed a commit that referenced this pull request Apr 5, 2022
It is unclear if having more than one circuit annotation even works. If
it does, it is implausible that they would have the same circuit name
since that would correspond to a namespace collision.

(cherry picked from commit aea60aa)
@mergify mergify bot added the Backported This PR has been backported to marked stable branch label Apr 5, 2022
mergify bot added a commit that referenced this pull request Apr 5, 2022
It is unclear if having more than one circuit annotation even works. If
it does, it is implausible that they would have the same circuit name
since that would correspond to a namespace collision.

(cherry picked from commit aea60aa)

Co-authored-by: Jack Koenig <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Backported This PR has been backported to marked stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants