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

Take advantage of associated type defaults once they hit stable Rust #188

Open
Veetaha opened this issue Nov 10, 2024 · 0 comments
Open
Labels
blocked Progress on the issue is blocked by some external factors enhancement New feature or request

Comments

@Veetaha
Copy link
Contributor

Veetaha commented Nov 10, 2024

I've tried the nightly feature #![feature(associated_type_defaults)] to get rid of repetitive type {Member} = Unset<member::{member}>; entries in impl blocks for Set{Member} typestates. This yielded a considerable compilation perf. improvement from 16% to 58% depending on the number of members. This is because it removes the quadratic growth of the number of associated type entries that we have today in the impl blocks.

See more details about my measurements in the comment under the tracking issue for associated_type_defaults: rust-lang/rust#29661 (comment).

Here is a commit where I tested this feature in bon (it's quite dirty, but proves the concept): f884ca9

This issue is blocked by the stabilization of associated_type_defaults.

A note for the community from the maintainers

Please vote on this issue by adding a 👍 reaction to help the maintainers with prioritizing it. You may add a comment describing your real use case related to this issue for us to better understand the problem domain.

@Veetaha Veetaha added enhancement New feature or request blocked Progress on the issue is blocked by some external factors labels Nov 10, 2024
@Veetaha Veetaha changed the title Take advantage of associated type defaults to improve compile perf. Take advantage of associated type defaults to improve compilation perf. Nov 10, 2024
@Veetaha Veetaha changed the title Take advantage of associated type defaults to improve compilation perf. Improve compliation perf. once associated type defaults hit stable in Rust Nov 10, 2024
@Veetaha Veetaha changed the title Improve compliation perf. once associated type defaults hit stable in Rust Improve compliation perf. once associated type defaults hit stable Rust Nov 10, 2024
@Veetaha Veetaha changed the title Improve compliation perf. once associated type defaults hit stable Rust Take advantage of associated type defaults once they hit stable Rust Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Progress on the issue is blocked by some external factors enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant