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

chore: simplify code generation logic for a faster and better UX #12493

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

masih
Copy link
Member

@masih masih commented Sep 19, 2024

Related Issues

Proposed Changes

The changes here simplify the string of targets executed as part of make gen. The simplifications include:

  • parallelised code generation whenever possible.
  • re-implementation of documentation generation for a significant simplification and improved readability.
  • unified mocks generation to avoid multiple slow calls to go run per package.

Note, the changes introduced here are purely mechanical and do not alter the Lotus node functionality.

Additional Info

Timing On CI

Timing On my machine

  • Before: make gen 105.22s user 56.84s system 152% cpu 1:46.46 total
  • After: make gen 54.30s user 36.99s system 178% cpu 51.247 total

Checklist

Before you mark the PR ready for review, please make sure that:

The changes here simplify the string of targets executed as part of
`make gen`. The simplifications include:
* parallelised code generation whenever possible
* re-implementation of documentation generation for a significant
  simplification and improved readability.
* unified mocks generation to avoid multiple slow calls to `go run` per
  package.

Note, the changes introduced here are purely mechanical and do not alter
the Lotus node functionality.

Fixes #8392
@masih masih added the skip/changelog This change does not require CHANGELOG.md update label Sep 19, 2024
@masih masih marked this pull request as ready for review September 19, 2024 15:03
Copy link

@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.

@masih masih requested a review from rvagg September 19, 2024 15:03
@masih masih changed the title chore: Simplify code generation logic for a faster and better UX chore: simplify code generation logic for a faster and better UX Sep 19, 2024
@github-actions github-actions bot dismissed their stale review September 19, 2024 15:07

PR title now matches the required format.

@rjan90
Copy link
Contributor

rjan90 commented Sep 19, 2024

I still have some cleanups/updates to do on my computer that makes it a little slow. But this is soooo much faster then when I ran a couple of days ago:

make gen 74.23s user 22.34s system 127% cpu 1:15.79 total

@masih
Copy link
Member Author

masih commented Sep 19, 2024

There is room for more improvements, e.g. not generating files that need fiximports, etc. But the correct fix IMHO is to simply do a lot less, which is a large divergence from the current approach and a big diff to go with it.

For now, more CPU cores to the rescue.

@Stebalien Stebalien merged commit 312fa3a into master Sep 20, 2024
106 of 107 checks passed
@Stebalien Stebalien deleted the masih/simpler-and-faster-make-gen branch September 20, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip/changelog This change does not require CHANGELOG.md update
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

Make make gen faster
4 participants