Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC Huge Model Poor Performance

I am using MVC 3 and one of my views is binding to a rather large model. The actual model has over 130 properties (all these are used in the view). Every time when I postback the view it is extremely slow, it takes ages until hits the server side. Is this cause by the fact that I have client validation enabled?

like image 835
Michael H. Avatar asked Sep 11 '11 20:09

Michael H.


1 Answers

What do you mean by "hits server side"?

It looks like a problem with model processing, not the problem with the framework. It really doesn't matter if your model has 5 or 130 properties - that shouldn't be user-noticeable at all. Double-check your model processing code for long-running operations. If the model object is that big I'm pretty sure there are ones somewhere.

Also, I'd advise checking the client-server communication for any problems (javascript, heavy forms and so on). Built-in tools in IE9/Chrome and Fiddler are enough to track those kinds of issues.

like image 200
Piotr Szmyd Avatar answered Nov 04 '22 15:11

Piotr Szmyd