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: remove direct tracing calls from proc-macros #1405

Merged
merged 5 commits into from
Jul 31, 2024

Conversation

DaniPopes
Copy link
Contributor

@DaniPopes DaniPopes commented Jun 11, 2024

This significantly reduces the amount of code generated by the rpc macro.
I've also taken the liberty to refactor some of the proc macro code to make it more maintainable.

For example, on the reth-rpc-api crate (just #[rpc(server)]):

  • before:
    • cargo expand: 156,020 LoC
    • cargo check -p after cargo clean -p: 3.1s
  • after:
    • cargo expand: 73,276 LoC
    • cargo check -p after cargo clean -p: 1.7s

@DaniPopes DaniPopes requested a review from a team as a code owner June 11, 2024 06:39
@DaniPopes DaniPopes force-pushed the tracing-procmacros branch 4 times, most recently from 6ff1cc7 to ae27f81 Compare June 11, 2024 08:00
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

Copy link
Contributor

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

Nice!

@DaniPopes
Copy link
Contributor Author

Hey @niklasad1 anything left to do here?

Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

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

LGTM!

One thing I wonder is; how do we avoid regressing again in this area? Maybe worth adding a CI check which expands some macros and logs the lines or something, so we get a feeling for changes over time and can note any large differences.

@niklasad1 niklasad1 merged commit bc7f8eb into paritytech:master Jul 31, 2024
10 checks passed
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.

4 participants