1

In my project, there is a page which has about 10-15 controls and, 3 tree views. It takes a lot of time to load as there is lot of logical checking required. How can I increase its speed (any method, code or database)? Please suggest some measures.

For eg: Every time the page loads, it checks whether the user is allowed to access that page or not. What controls he can access? The tree views are also binded based on the user access only.

On the loading of each controls, it again and again goes to fetch data. How can it be minimized?

5
  • 10
    First suggestion, show something to work with. Your problem is probably on line 13, but we need more info. Commented May 29, 2012 at 13:05
  • Identify the code that can run parallel without any dependency on each other and split the code using threads. Commented May 29, 2012 at 13:06
  • 2
    gbianchi, how you find the line 13 without having any code. Commented May 29, 2012 at 13:09
  • @gbianchi which line 13 are you talking about? I didn't got it. Please explain. Commented May 29, 2012 at 13:11
  • @coder311 - We cannot help you unless you post the code for us. Commented May 29, 2012 at 13:13

4 Answers 4

2

Start with front-end optimization.

  1. Disable ViewState of the controls, whereever it is not required.
  2. Set Expire headers for your static content. (Browser caching)
  3. Enable GZIP compression.

Install YSLOW, PageSpeed....for more recommendations.

YSLOW

PageSpeed

Then, come backend optimization:

Cache frequently accessed data

Do some code refactoring.....more

Sign up to request clarification or add additional context in comments.

Comments

1

Try a profiler (the JetBrains one is good) on your application, it'll show you where your pinch points are. If you think it's database related, run explain plan/showplan on your queries to show how long they're taking and where they're spending their time. Really, your bottleneck could be anywhere, it'll take some legwork to track it down (it could even be network related).

1 Comment

dotTrace does come with a free trial period. There are others out there but I can't really say I've used them, sorry.
1

Once a user is authenticated, cache his logged-in status and use that in your code; see if this makes a difference. Also, cache the data per user. You could use Session state to do this.

Also, set the trace attribute to true in your page directive tag - just to be sure this is what is causing the performance hit.

Comments

1

OutputCache can increase some shared partialview/usercontrol.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.