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

[#experiment ]Associated Reader/Writer #922

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

[#experiment ]Associated Reader/Writer #922

wants to merge 2 commits into from

Conversation

burrbull
Copy link
Member

Related to #902

@rmsyn This is required step to make register write methods generic over crates: https://github.com/burrbull/reg

But it is slower to compile:
For example stm32f4 crate on old PC:
Before PR: 6.92 s
After PR: 10.23 s

Copy link
Contributor

@rmsyn rmsyn left a comment

Choose a reason for hiding this comment

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

But it is slower to compile:
For example stm32f4 crate on old PC:
Before PR: 6.92 s
After PR: 10.23 s

Not completely sure what created the drastic increase in compile times. However, maybe removing the extra trait resolution will bring it back down?

Comment on lines +108 to +115
pub trait FromBits<U> {
unsafe fn from_bits(b: U) -> Self;
}

#[doc(hidden)]
pub trait ToBits<U> {
fn to_bits(&self) -> U;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If these traits are not intended to be used externally, maybe we can implement Readable without the extra layer of trait resolution?

I'm thinking along the lines of creating a helper macro to implement the Readable trait on the needed types.

Copy link
Member Author

Choose a reason for hiding this comment

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

I forgot about inline.
Now it is 7.94 s

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