We have moved to GitHub Issues
Created by Dan Bramall 18 Oct 2017, 08:46:54 Updated by Sebastiaan Janssen 18 Jul 2018, 12:46:40
Currently when calling
IsAncestorOrSelf the method checks all ancestors recursively for a matching id:
return other.AncestorsOrSelf().Any(x => x.Id == content.Id);
Particularly when content is deeply nested this will result in a lot of objects being created in memory. It's proposed that comparing the
path values instead would be more performant/less memory intensive.
Pull request on the way...
This is a good performance improvement, saves on traversing up the object tree.
Created a new PR, rebased and extra commits added (to Dan's original one). https://github.com/umbraco/Umbraco-CMS/pull/2768
Just to note, a bit of extra work was required: https://github.com/umbraco/Umbraco-CMS/pull/2787
Type: Performance Problem
Backwards Compatible: True
Fix Submitted: Pull request
Due in version: 7.12.0