We have moved to GitHub Issues
Created by Shannon Deminick 25 Sep 2013, 00:09:41 Updated by Sebastiaan Janssen 30 Sep 2013, 12:50:29
If you subscribe to events:
BeforeTreeRender, AfterTreeRender for either the content/media trees then you will get n+1 performance issues.
With the changes in 6.1.x these trees render with the EntityService which should query much faster than the previous way, however if you subscribe to either of these events (and worse both) then for each rendered node it will do a full Document or Media lookup.
If you then also subscribe to RenderNode for either of these trees, then this same situation will also occur but you can slightly improve performance by overriding LoadMinimalDocument and set to true (though the performance gains will not be huge if you have a lot of child nodes).
To fix these we should just check for subscriptions to any of these events and if there are any than we need to render these trees the old way - or we can also load the child Document/Media items once and then pass these items into the events but this will mean that we have to both lookup entities and the real items.
I've fixed this all up for both content/media trees by detecting if we can run in optimized mode or not. If we cannot run in optimized mode it will execute the legacy way by loading in document/media children - this will still be much faster than it is currently because we won't have n+1 problems. If we detect we can run optimized then it of course will be much faster.
This has been fixed in a8f6b9eeb9ceebf6c2c85cbee4f526626beda8f6
And updated again in : 15d2021786988a541620780fdc30cef38ec2e789, 4df79ce55b5bf3578aa3c01c1c2b4d7228fc2beb
Assignee: Shannon Deminick
Backwards Compatible: True
Affected versions: 6.1.0, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5
Due in version: 6.1.6