views:

137

answers:

1

I have an MVC view with a partial view recursive call that displays hierarchical data.

The complete tree typically includes in the order of 500 or so items.

The data is all included in the model, and the model's a trivial record class - nothing in it except auto-properties.

In IIS this works fine.

However in Cassini/WebDev (Visual Studio's built in web server) this page runs painfully slow and often times out.

A little digging shows that this is due to each call to Html.RenderPartial taking around 200ms (or 1/5 of a second). The actual partial view seems to take under a millisecond or so.

Anyone got any ideas why this is so slow?

Why would it be different between IIS and Cassini? The IIS application is pointed at my development directory; they're running exactly the same code, build and config.

+3  A: 

I think this could be related to the caching of view resolved paths. The article here explains the issue to which I am referring.

Do you notice the same behaviour if you pass the full path of the view, like:

 RenderPartial("~/Views/MyView.ascx")

Kindness,

Dan

Daniel Elliott
Thanks (+1) that fixes the issue but doesn't quite explain why. Both services are running the exact same code (a debug build) with the exact same web.config - why does Cassini decide to ignore the cache?
Keith
This is likely because Debug = true on one of the servers, and = false on the other.
Gregory