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

feat: derive Allocative on FixedBytes #531

Merged
merged 4 commits into from
Feb 27, 2024

Conversation

Rjected
Copy link
Collaborator

@Rjected Rjected commented Feb 16, 2024

Motivation

Recently I was introduced to https://github.com/facebookexperimental/allocative, which seems promising as an easy way to collect granular information about certain data structures' memory usage in reth.

Solution

Introduce the allocative feature into primitives, and to start, derive the Allocative trait on FixedBytes. I can derive this on the rest of the types later.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

imo ok since its cfg gated, although ci fails because allocative requires nightly?

@DaniPopes
Copy link
Member

Fails on 1.65 because it has higher MSRV

@DaniPopes
Copy link
Member

@Rjected do you want to add it to more types?

@Rjected
Copy link
Collaborator Author

Rjected commented Feb 19, 2024

@Rjected do you want to add it to more types?

I do, as many as possible

@gakonst
Copy link
Member

gakonst commented Feb 20, 2024

Yep this will improve profiling on Reth

@Rjected
Copy link
Collaborator Author

Rjected commented Feb 21, 2024

@DaniPopes I think this is good for now, will open another PR when I get around to bytes stuff

@@ -16,8 +16,15 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: ["stable", "beta", "nightly", "1.65"] # MSRV
rust: ["stable", "beta", "nightly"]
Copy link
Member

Choose a reason for hiding this comment

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

are we updating our MSRV policy?

Copy link
Member

Choose a reason for hiding this comment

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

No, just not testing --all-features because this feature requires a higher MSRV

@DaniPopes DaniPopes merged commit 1a2bdae into alloy-rs:main Feb 27, 2024
21 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.

5 participants