Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8196699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:34:16+00:00 2026-06-07T05:34:16+00:00

What is the best way (performance wise) to display all the categories and respective

  • 0

What is the best way (performance wise) to display all the categories and respective sub-categories with images when the page loads so that I may style the content with an UL LI to display inside Mega Menu?

I was thinking to run a query from the control that contains the Mega Menu which should output all the published categories and sub categories. But this will constantly go back to the server to run the query? Bad for performance!

Then I thought run the query that outputs the data in an XML file on the client machine (obviously it will run the query from the server the first time) but subsequently it will read off the XML file. Then I style the XML data using XSLT within my Mega Menu control.

Please advise? I am using NopCommerce 1.9 using C# ASP.NET

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:34:18+00:00Added an answer on June 7, 2026 at 5:34 am

    You’re essentially just shifting one performance concern for another. What you’re describing is known as the N + 1 SELECT problem. See this code project article for a quick description: Select N+1 Problem – How to Decrease Your ORM Performance.

    Now, I don’t know if you’re using an ORM, but it’s the same problem regardless of your data access layer. Should you lazy load only one level of your nested hierarchy and save your client from having to run N queries (each requiring a round trip) to load children of each node? Or should you eagerly load your entire hierarchy to the client and render it on demand. The answer is “it depends”. You likely know your data best.

    If your hierarchy is really deep and has many levels, see if your typical user usage drills deep into this hierarchy or not. If only 20% or less of users drill down then maybe a lazy load solution is fine for you.

    If the data that comprises your categories isn’t very large (I would say, less than 50K), then it’s a no brainer to eagerly load all your data and render it on your client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe that's a silly question... But what's the best (performance and memory wise) way
I would like to know what the best way (performance wise) to access a
If there's a TextBlock inside a Grid, what's the best way (performance wise) to
What would be the best (performance, memory wise) to achieve a clean way to
What is the best way (performance-wise) of returning stl containers from a function? The
What is the best way (performance wise) to paginate results in SQL Server 2000,
What is the best way performance wise to take a list of words and
What is best way to write query performance wise. e.g. i can write query
Which is the best way (in performance and security) to send multiple parameters to
What is the quickest and best performance way to turn a string into a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.