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

Faster ChiselPlugin #1590

Merged
merged 1 commit into from
Sep 15, 2020
Merged

Faster ChiselPlugin #1590

merged 1 commit into from
Sep 15, 2020

Conversation

jackkoenig
Copy link
Contributor

Use caching to reduce number of expensive lookups. Also make methods private so we can improve them without breaking binary compatibility

I think this could be better, like only doing a single lookup, but I was having trouble getting it working so thought it better to just get this out here. This reduces the runtime of the Chisel plugin in rocket-chip compile by quite a bit (collected with scalacOption -Ystatistics):

Before:
[info]   typer                       : 1 spans, ()32910.11ms (27.8%)
[info]   chiselcomponent             : 1 spans, ()29308.0ms (24.7%)

After:
[info]   typer                       : 1 spans, ()26130.235ms (42.1%)
[info]   chiselcomponent             : 1 spans, ()6523.072ms (10.5%)

Typer included for reference (also shows how noisy the measurements are).
With this change, chiselcomponent is generally 2-4x faster.

Contributor Checklist

  • 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

Some methods that shouldn't have been public in the compiler plugin are now private

Backend Code Generation Impact

No impact

Desired Merge Strategy

  • Squash

Release Notes

Improve performance of the Chisel Scalac compiler plugin over that in 3.4.0-RC1

Reviewer Checklist (only modified by reviewer)

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

Use caching to reduce number of expensive lookups
@jackkoenig jackkoenig added this to the 3.4.0 milestone Sep 15, 2020
@jackkoenig jackkoenig requested a review from azidar September 15, 2020 16:17
@jackkoenig jackkoenig requested a review from a team as a code owner September 15, 2020 16:17
@jackkoenig jackkoenig merged commit b4f2b7a into master Sep 15, 2020
@jackkoenig jackkoenig deleted the faster-chiselplugin branch September 16, 2020 17:33
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