-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Create and use StableTypeId instead of TypeId #32
Copy link
Copy link
Closed as not planned
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!S-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!S-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
std::any::TypeIdis not stable across binaries. This makes it unsuitable for use in scene files, networking, or dynamic plugins.In the short term we get around this by just using
std::any::type_name. But this isn't particularly efficient for certain serialization cases andEq/Hashtraits. Legion uses TypeIds extensively and we've (in the short term) replaced those withtype_nameto allow for dynamic plugin loading. But that probably incurs measurable overhead.Its worth exploring the idea of a
StableTypeId, which is just a wrapped integer. I think it makes sense to use a const-hashing algorithm on type_name to produceStableTypeIds