How much time to compile a view in ASP.NET?
Asked Answered
R

1

0

How much time is spent compiling a view in ASP.NET?

Of course I don't expect anyone to give me a number, but I think it's interesting to have an idea of how much time this takes because it could influence the way we implement things.

For example, if the time is significant , then I might try to put every result that I need to display in the view in a model class instance (created just to hold the values in such a way that I don't even have to test for objects with null value) and then minimize to the maximum (uh?) the amount of C# code in the view thus decreasing the amount of time necessary to compile the view.

Question

Does this make sense? Give some thoughts on this one.

Rosellaroselle answered 1/10, 2010 at 23:1 Comment(0)
S
1

To me it sounds like with this approach you are entering a world of pain. Your optimizing before knowing if there are any per issues. Better is to identify them and deal with those. Also whatever "figures" you get here are just arbitrary. Instead create some pages and trace/profile to find slow areas.

From your question it's not clear if you are using Web Forms or MVC either.

Also you might be interested in Planning for efficiency early vs Premature optimization

Sacker answered 2/10, 2010 at 1:0 Comment(1)
It makes perfect sense and of course I will test some pages and test what time differences I will get. I did not refer to Web forms or MVC because I am not aware that view compile times were different. Are they? Using a class Model to send data to the view is already something that is normal, doing this doesn't seem like a pain to me in any way. My doubt is if is worthy and you say it's not. But why would this be a world of pain? Thanks.Rosellaroselle

© 2022 - 2024 — McMap. All rights reserved.