Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micro-optimize String building in _computeName #2472

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

jackkoenig
Copy link
Contributor

This is very much a micro-optimization, but I was looking at Flamegraphs and noticed 2 StringBuilders when there should only be 1. The String concatenation before adding to the String builder results in an unnecessary String copy. This is peanuts compared to most of the object creation going on in Chisel, but it is noticeable in a Flamegraph so I figured I'd fix it.

Contributor Checklist

  • [NA] Did you add Scaladoc to every public function/method?
  • 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?
  • [NA] Did you add appropriate documentation in docs/src?
  • 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

Micro-optimize performance of computing names of signals

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (Bug fix: 3.4.x, [small] API extension: 3.5.x, API modification or big change: 3.6.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

@jackkoenig jackkoenig added this to the 3.5.x milestone Apr 5, 2022
@jackkoenig jackkoenig added the Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. label Apr 5, 2022
@mergify mergify bot merged commit 3940136 into master Apr 5, 2022
@mergify mergify bot deleted the micro-optimize-computeName branch April 5, 2022 03:43
mergify bot pushed a commit that referenced this pull request Apr 5, 2022
@mergify mergify bot added the Backported This PR has been backported label Apr 5, 2022
mergify bot added a commit that referenced this pull request Apr 5, 2022
(cherry picked from commit 3940136)

Co-authored-by: Jack Koenig <koenig@sifive.com>
jackkoenig pushed a commit that referenced this pull request Feb 28, 2023
emission-options flags swapped to match their functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported This PR has been backported Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants