-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Entity cmp::Eq improvement #2346
Copy link
Copy link
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile times
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile times
What problem does this solve or what need does it fill?
Current Entity comparison relies on rust's
#derive(Eq, ...)It now actually makes two comparisons (see asm code)
https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=38662860685c22c6cbaf0a14a7e38b8b
What solution would you like?
If treat whole Entity struct as u64 (through pointer cast on comparison, or even by store generation+id as u64) this could become one bitwise comparison.
https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=3351c4c203e76073de253b3301ed8d13