While opimising a Nop (1.7) site and running variuos speed test it has become apparent that the Category structure can effect page load times.

This seems due specifically to the CategoryNavigation.ascx control and occurs as follows;-

The control displays all categories in parent category levels above the selected category.

The control displays all categories at the selected category level.

The control displays all sub categories of the selected category.

Take these three structures (assume every category has these numbers for simplicity);-

(A) - total 100,000 categories
top level 10 categories
2nd level 10 categories
3rd level 10 categories
4th level 10 categories
5th Level 10 categories

(B) - total 100,000 categories
top level 10 categories
2nd Level 100 categories
3rd level 10 categories
4th level 10 categories

(C) - total 100,000 categories
top level 10 categories
2nd Level 10 categories
3rd level 100 categories
4th level 10 categories

(D) - total 100,000 categories
top level 10 categories
2nd Level 10 categories
3rd Level 10 categories
4th Level 100 categories

when navigating down these structures the following number of lines will be written out in the category navigation control

Top level
A) 20
B) 110
C) 20
D) 20

2nd Level
A) 30
B) 120
C)120
D) 30

3rd Level
A) 40
B) 130
C) 130
D) 130

4th Level
A) 50
B) 130
C) 130
D) 130

As you can see structure A has 2.6x less to write out on the page compared to the other cases. That's 2.6x less processing on the server and 2.6x less information to be sent to the users browser. However there are still the same number of categories within the structure. There is however another level to navigate through, however if your pages are quick enough (and your structure intuitive) I doubt the user will mind.

There are also no category pages with a large number of subcategories displaying in the body, when using structure A. These '100 subcat' pages will go even slower due to this, however the point is they slow category pages with no/few subcategories on them due to the category navigation control.

While it can be see that it is better to place large numbers of categories further down the tree, eventually you pay for it. Even in case D you pay for the 100 level 4 categories when on level 3.

Anyway hope that helps people with speed issues it's not always the code/imagery that is slow, it depends how you organise the data.

Dave