UmbracoHelper.TypedContentAtRoot() extremely slow when U have a lot of child nodes
Hi Dear Everyone,
Please help with UmbracoHelper performance.
Short story:
I have quite simple content structure:
project->user->stuff
While I have to identify project by some internal fields I did it like this:
Umbraco.TypedContentAtRoot().Where(....
Everything was perfect until the moment when in some project I got almost 2k child nodes (User type) and performance slowed almost to 100 times! (from ~100-200mc to 10-20seconds)
I played with structure and figured out that initializing Children isn't lazy, and every time when I just need to get list of root nodes I'm getting the list of Initialized Children.
I fixed it by getting root nodes from (as U said - very slow and not preferable way for getting content) "ContentService" - it's not that fast, but obviously faster what I have now.
P.S. I'm open with any kind of suggestions regarding possible ways to solve it in right way (not just changing structure - cause for me it's normal situation when U have a lot of subNodes) or just ask Umbraco Core team to get Children lazy.
Would love to help but I might need a bit more, I am not sure of another technique than the one you are using that would be faster, I am curious to know what the internal fields you are looking at are?
Is it for example id and name checks or something more complex such as items with a particular node selected within a node picker property type?
trying to materialize nodes and then filter them, I got exactly the same delay, I mean around 10-20 seconds on ToList() step just for 9 root elements! (only few of them, have 1k or 2k child nodes, all other not that big)
P.S. I apologize that I haven't done it at first, here is some additional tech info regarding my project:
Umbraco 7.4.1 & 7.4.3 (I got exactly the same delay with ToList()
withput any rule in each of them)
My umbraco.config file is only 1.5M
all other settings are default as for Nuget package
Sorry for the late reply.... I missed notification somehow.
So, the main point is - that it's pilot project where I decided to use Umbraco as "Content holder + Admin Panel" only, so I dont' have any template/view in my project. All clients just using REST.
Yes, I agree that, cache may be used even in my case, but damn, there are up to 20 elements at root level :( ...
UmbracoHelper.TypedContentAtRoot() extremely slow when U have a lot of child nodes
Hi Dear Everyone,
Please help with UmbracoHelper performance.
Short story:
While I have to identify project by some internal fields I did it like this:
Umbraco.TypedContentAtRoot().Where(....
Everything was perfect until the moment when in some project I got almost 2k child nodes (User type) and performance slowed almost to 100 times! (from ~100-200mc to 10-20seconds)
I played with structure and figured out that initializing Children isn't lazy, and every time when I just need to get list of root nodes I'm getting the list of Initialized Children.
I fixed it by getting root nodes from (as U said - very slow and not preferable way for getting content) "ContentService" - it's not that fast, but obviously faster what I have now.
P.S. I'm open with any kind of suggestions regarding possible ways to solve it in right way (not just changing structure - cause for me it's normal situation when U have a lot of subNodes) or just ask Umbraco Core team to get Children lazy.
Hi StasN,
Would love to help but I might need a bit more, I am not sure of another technique than the one you are using that would be faster, I am curious to know what the internal fields you are looking at are?
Is it for example id and name checks or something more complex such as items with a particular node selected within a node picker property type?
Atb,
M
Hello MarcC,
Thank U for your question.
U are absolutely right, I was trying to filter my rootNodes by some custom fields, like this:
But! when I did like this:
trying to materialize nodes and then filter them, I got exactly the same delay, I mean around 10-20 seconds on ToList() step just for 9 root elements! (only few of them, have 1k or 2k child nodes, all other not that big)
P.S. I apologize that I haven't done it at first, here is some additional tech info regarding my project:
Hi Stas,
Can you show all code of your view?
By the way, did you try to use caching?
Its really cool helper ChachedPartial, read more - https://our.umbraco.org/documentation/Reference/Templating/Mvc/partial-views
Thanks,
Alex
Hi Alex,
Sorry for the late reply.... I missed notification somehow.
So, the main point is - that it's pilot project where I decided to use Umbraco as "Content holder + Admin Panel" only, so I dont' have any template/view in my project. All clients just using REST.
Yes, I agree that, cache may be used even in my case, but damn, there are up to 20 elements at root level :( ...
is working on a reply...