Skip to content

Entity cmp::Eq improvement #2346

Closed
@tower120

Description

@tower120

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile times

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions