-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Make entity generation a new type and remove identifier #19121
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
Make entity generation a new type and remove identifier #19121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just some nitpicking. The changes look good and I love that this PR demonstrates the rolling updates we can do to migration guides.
|
||
/// Returns the [`EntityGeneration`] that would result from this many more `versions` of the corresponding [`EntityRow`] from passing. | ||
#[inline] | ||
pub const fn after_versions(self, versions: u32) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future PR: might be nice to implement Iterator<Item = Self>
for EntityGeneration
. That gives an idiomatic next
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed some typos in the migration guide
Co-authored-by: Mark Nokalt <marknokalt@live.com>
Benchmarks looks good, sparse set change detection was the only thing that was slowed down by anything notable. But I don't think that's a big deal. Other than that, I think this is generally an improvement in perf. (Less checks when changing the generation.) Also want to point out that we loose a niche on |
Objective
This is a followup to #18704 . There's lots more followup work, but this is the minimum to unblock #18670, etc.
This direction has been given the green light by Alice here.
Solution
I could have split this over multiple PRs, but I figured skipping straight here would be easiest for everyone and would unblock things the quickest.
This removes the now no longer needed
identifier
module and makesEntity::generation
go fromNonZeroU32
tostruct EntityGeneration(u32)
.Testing
CI