views:

291

answers:

2

What is the performance impact of using Page.LoadControl in ASP .NET to load User Controls that are compiled outside of the "parent" application?

+1  A: 

That completely depends on the complexity of the control you're loading into the page.

Joseph
I'm inclined to agree with you, however I'm concerned about the performance cost relative to loading the user control's assembly and creating an instance instead of the control's assembly being compiled into the "parent" application.
Achilles
I'd suspect that shouldn't be a concern outside of the first hit. Once the assembly is loaded, there should be zero pain of referencing the controls.Now, what happens in the page lifecycle is a different question requiring a fair bit of metrics to get at the correct answer.I'd bet that in real-world terms, the overhead involved will be less significant than adding an image request to a page in terms of actual throughput to the browser.
Wyatt Barnett
A: 

It also depends on how many controls you want to load and where in the Page life-cycle. A few controls is okay for the performance, if it isn't too complex as said by Joseph. However when you add 20/30/or more controls every step in your life-cycle will dramatically increase.

Joop
Thanks. I'll keep this in mind.
Achilles