Sitecore is “taking too long”…
So I was working on an .xslt rendering and everything was fine until I tried to preview my rendering on a page in Sitecore and it just took forever and ever to load. When I clicked on another item or, infact anything in the Sitecore client, it completely crashed and it was just a complete mess.
I got the latest version of the project in Visual Studio, I rebuilt the project, restarted IIS, restarted Sitecore, restarted the whole Virtual PC (that Sitecore was running on), restarted my entire PC and in between tried to get some suggestions from my work colleagues.
This was going on for about two and a half hours and I just couldn’t figure out what was going on. I decided to give up and thought maybe it will be okay the next day.. dunno how that thought would’ve worked?
The next morning, same chaotic problem, this time I got a big fat error message saying “Server application unavailable”. I installed a new copy of a virtual machine and did the whole restart thing. Still nothing. Another two hours had gone by. I asked around to see if any of the other developers were experiencing the same problem. And well.. a couple of guys had the same sort of problem.
We thought quite possibly, there was a problem with a rendering on the page. So we tried adding a couple of developers renderings to a page and seeing which one made the page take forever to load. Funnily enough, it was my rendering. Richard and I sat down and went through my code. And there it was. Recursion.
From Wikipedia:
“Recursion, in mathematics and computer science is a method of defining functions in which the function being definied is applied within its own definition. The term is also used more generally to describe a process of repeating objects in a self-similar way.”
Yes I should have gotten the award for the best unknown recursive rendering. I was so embarassed! Richard laughed. And I’m sure in the back of the other guys heads they’re thinking, “what a dumbass!!”
So next time I think that Sitecore is way too slow for my patience, I’ll make sure theres no recursive action going on..
