You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #20135, building a user-submitted model shows a huge amount of time spent in Attribute.IsDefined, called from ForeignKeyAttributeConvention.FindForeignKeyAttributeOnProperty (and other conventions). I suspect that the inherit flag increases the perf cost, and the model in question seems to have quite a bit of hierarchy.
In addition, it seems like the same MemberInfo gets checked more than once; introducing a simple Dictionary<MemberInfo, bool> cache in ForeignKeyAttributeConvention for the results of Attribute.IsDefined reduced model building time from 79 to 45 seconds. After this I can still see other call-side for Attribute.IsDefined showing up (e.g. PropertyAttributeCOnventionBase) - we may want to investigate if it makes sense to be traversing the same members/entity types multiple times, and if so, consider adding caching.
The text was updated successfully, but these errors were encountered:
In #20135, building a user-submitted model shows a huge amount of time spent in Attribute.IsDefined, called from ForeignKeyAttributeConvention.FindForeignKeyAttributeOnProperty (and other conventions). I suspect that the inherit flag increases the perf cost, and the model in question seems to have quite a bit of hierarchy.
In addition, it seems like the same MemberInfo gets checked more than once; introducing a simple
Dictionary<MemberInfo, bool>
cache in ForeignKeyAttributeConvention for the results of Attribute.IsDefined reduced model building time from 79 to 45 seconds. After this I can still see other call-side for Attribute.IsDefined showing up (e.g. PropertyAttributeCOnventionBase) - we may want to investigate if it makes sense to be traversing the same members/entity types multiple times, and if so, consider adding caching.The text was updated successfully, but these errors were encountered: