Orchard Brotips: having a big menu perfoming well

Tags: development, performance, menu, Orchard brotips

TL;DR: use custom links only.

Why? Because custom links are the only type of menu links that have all their content parts pre-fetched, thus a menu consisting even of thousands of items will still issue a single DB request. On the other hand other types of links use other parts that are lazily loaded, resulting in an N+1 scenario: there's a query to begin with and for every item there's a subsequent query. Content item links let you link to a content item conveniently but this convenience comes with a great price: with them this "a subsequent query" is rather "6 subsequent queries" even if nothing special happens. And when this is the case with a menu having several hundreds of items then... ...then you're basically serving a menu to your visitors performance-wise as other parts of the site will take negligible amount of resources compared to the menu.

FYI all this is valid for Orchard 1.6. Performance of navigation may have changed in the latest source.

No Comments

Add a Comment