-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Remove ArchetypeComponentId
and archetype_component_access
#19143
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
base: main
Are you sure you want to change the base?
Conversation
Merge archetype_component_access and new_archetype methods into run_unsafe and get_param.
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.
Easy approve! Everything looks good to me.
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.
I like it! This should make queries as entities straightforward now, right?
Some stats on memory savings on 64-bit systems:
-8 bytes
per component per archetype-8 bytes
per resource-4 bytes
per system (SystemState)- at least
-128 bytes
per system (SystemMeta) - at least
-128 bytes
per combinator system - at least
-128 bytes
per pipe system
Objective
Remove
ArchetypeComponentId
andarchetype_component_access
. Following #16885, they are no longer used by the engine, so we can stop spending time calculating them or space storing them.Solution
Remove
ArchetypeComponentId
and everything that touches it.The
System::update_archetype_component_access
method no longer needs to updatearchetype_component_access
. We do still need to update query caches, but we no longer need to do so before running the system. We'd have to touch every caller anyway if we gave the method a better name, so just removeSystem::update_archetype_component_access
andSystemParam::new_archetype
entirely, and update the query cache inQuery::get_param
.The
Single
andPopulated
params also need their query caches updated inSystemParam::validate_param
, so changevalidate_param
to take&mut Self::State
instead of&Self::State
.