views:

62

answers:

1

Hi all

Is there any deficiency performance if import a lot of name space in Web.config or in every single cs file while it's not necessary to be in all classes ?

Thank you

+1  A: 

Short answer: No, there shouldn't be any runtime performance impact. 'import' is a compiler directive that is more related to compilation.

However depending on the nature of the way you deploy your website/webapp, the compilation might take place during 'production' and hence might have some influence, though I would not think it'll be much.

o.k.w
So , Whey VS doesn't import more name space in default ?
Mostafa
It picks the more relevent ones according to the project type. If it imports everything, there might be conflicts. E.g. TextBox in WebControls and WinForm Controls. And you wouldn't want 200 lines of import statement for every file right?
o.k.w
Thank you , I get it .
Mostafa
Welcome, glad you got the idea. :)
o.k.w