Closed Beider closed 3 years ago
A few followups to this,
An idea for precaching would be to have a few methods like,
// Precahce just the given type
this.GetMDReflectionCache().PreCahceType(type);
// Precache the list of types
this.GetMDReflectionCache().PreCahceTypes(List<Type>);
// Precahce everything in a namespace
this.GetMDReflectionCache().PreCahceTypesInNamespace(string namespaceName);
The MDFramework relies heavily on reflection, however reflection is rather slow. This is particularly apparent inside
MDGameInstance.RegisterNewNode(Node Instance)
To solve this problem a reflection data cache should be added, preferably this should be hidden inside MDStatics / MD*Extensions and be used across the entire framework. It would also be good if this cache was accessible for the people who use the framework so they can use the same cache for their own reflection needs.