ASP.NET MVC performance
What aspects of MVC performance affect your web application performance the most? Database access is usually pointed out as the default culprit but are there other components that have an impact? Do you prioritize the number of concurrent clients, the memory used on the server, the response time, or something else?
开发者_如何学GoThis answer contains some very good general suggestions but I'm looking for specifics of where the framework falls short of your expectations.
The ASP.NET MVC framework is great and sites like this one which is using it are obvious examples. There is nothing in it that affects my applications performance. It just works very nice. What affects performance is poor code or poor architecture conception but that's definitely not something we can blame the framework for. After spending years with ASP.NET webforms I cannot say that the performance of MVC is worst or better, what I can say is that it converted the painful experience of writing web applications into something that brings so much joy. I've been successfully running applications in production since ASP.NET MVC 1.0 and never had any problems.
In your question you mention database access => that's a problem that all web applications have and which is not inherent to the framework being used. Also in heavy traffic sites the usage of caching could improve performance and ASP.NET MVC have some really good caching mechanisms built-in.
So, all I can say is that you and the team delivering this great framework are doing a very good job.
Now that I realize who is asking this question I understand the question better.
The biggest problem I've had with MVC is that RenderPartial can be very slow when you're using embedded resources as views. If I remember this was caused by the VirtualPathProvider not performing that well. We ended up trying to use memoization to speed some calls up but eventually had to start writing directly to the view output stream.
I think we ran into the same issue as the lostechies guys did with a similar take on their input builders only we used it to generate grids.
http://www.lostechies.com/blogs/hex/archive/2009/06/14/opinionated-input-builders-part-7-more-on-performance-take-2.aspx
精彩评论