2

I'm developing high load solution with final version of asp.net mvc. Recently our team noticed, that most of the time that takes a server to response to client is devoted to page rendering. Simple time-schedule looks like this:

Page start   - 1.8608363s
Render module 1140/Modules/Owners start      - 1.86859s
Render module 1140/Modules/Owners Complete   - 1.9081751s
Render module 829/Modules/Links start    - 1.9081788s
Render module 829/Modules/Links Complete     - 2.3380648s
Render module 1036/Modules/Advertisement start   - 2.3459101s
Render module 1036/Modules/Advertisement Complete    - 2.3482298s
Render module 1110/Modules/Goodies start     - 2.3482322s
Render module 1110/Modules/Goodies Complete      - 2.6300744s
Render module 1004/Modules/TopicLinks start      - 2.6300784s
Render module 1004/Modules/TopicLinks Complete   - 3.8852529s
Render module 1048/Modules/News start    - 3.8927697s
Render module 1048/Modules/News Complete     - 4.4958795s
Render module 1128/Modules/SuggestedLinks start      - 4.4958832s
Render module 1128/Modules/SuggestedLinks Complete   - 4.5704227s
Page end     - 4.5711193s
TopicMainMenuPages start     - 4.5717661s
TopicMainMenuPages End   - 4.571974s
Render Finished      - 4.6185852s

What could be a reason for such a slow rendering? Is that for oftentimes using of partial render during single request?

DaveRandom
  • 87,921
  • 11
  • 154
  • 174
  • @Daniel is spot on. Even in MVC 3 in release mode Render partial is slow. I was curious why dynamically rendering the default mvc web app home page took almost 200ms, I googled and found this post. After reading this post I deleted the Html.RenderPartial calls from the master template and render times dropped to 2ms even in Debug Mode. For Dynamic pages that don't cache well that makes Html.RenderPartial a likely suspect when you have performance problems – Glenn Apr 01 '11 at 20:22

1 Answers1

5

Make sure the compilation debug="false" in your web.config and build your application in Release mode. This will allow the MVC framework to cache the paths that it resolves for your partial views.

See the article here for more info.

Kindness,

Dan

Daniel Elliott
  • 22,647
  • 10
  • 64
  • 82
  • Thanks, Daniel. It gave us up to 2 seconds of performance in average. Everything else is up to our BL modules. –  Oct 19 '09 at 12:15
  • My page was taking 10 sec to load and now it's less than 1 sec! – the_lotus Jan 15 '12 at 19:51