Performance with flat node hierarchies

Nov 12, 2008 at 11:27 AM
Hello,

I'm trying to benchmark N2. I have a node hierachy with the second-last node having 1000 children. When hitting one of these childnodes, I don't get very many request/sec, even with NHibernate caching enabled. The problem seems to be that, in order to resolve the URL, N2 actually news-up all the children, to determine which one of them matches the url. That means 1000 constructor-calls pr. request with heap-allocations and stuff. Is there any way to avoid this? One could presumably rewrite the url-resolving code (N2.ContentItem.GetChild(string childName)), either to use a node-cache, or to look directly in the database to figure out which nodes are needed to resolve a particular url -- but we'd rather not :-).

Any suggestions?

Michael
Coordinator
Nov 12, 2008 at 10:48 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Nov 12, 2008 at 10:59 PM
N2 started out with caching for the url parsing scenario. I removed a while back but it wouldn't be hard to re-introduce it. I would be interested in learning about your result. Perhaps you could help me find other weak spots to adress.

Flat hierarchies are the downside of the tree structures. It's usually better if it's possible to partition the data. I did a test a while back, you should remove a constant from the timings due to firefox and visual studio dev server.