views:

407

answers:

2

I just switch my website over to MVC from Webforms and I am using ajax very heavily. MVC seems to be slower but I haven't set up anything to record benchmarks.

Does anyone know which is faster for ajax handling and why it's faster?

+4  A: 

You shouldn't see any difference from one framework to the next. They are essentially the same with an exception of less things going on in the execution pipeline of the MVC framework, less stored (no state tracking), etc. How are you doing ajax in your site? Are you using partials? Full views? Rendering json or fully formatted html chunks?

Andrew Siemer
There are a few partials I'm bringing in, but the ajax requests are not modifying the partials that are brought in at all and I'm rendering json.
Matt
It could be that I just have more layers now than I did in Webforms. Following the string MVC pattern and including repositories, etc to separate all different types of logic probably slows things down. Is it a bad idea to remove a few layers just for the sections that need quick response?
Matt
I wouldn't sacrifice good design for speed before trying what you can to crank out as much speed as possible. Look into things such as caching, query tuning, etc. long before you start to tear apart your tiered architecture!
Andrew Siemer
+1  A: 

A good tool to use for profiling is either Firebug in Firefox, or Fiddler for IE/Chrome.

AJAX is known for being very chatty with the web server without the users knowledge , whereas a Webform is very explicit in showing when it is posting data back to the server.

It could be psychological, but profile the HTTP connections yourself and see!

Jeff Meatball Yang