c# - Better performance when importing just a part of a library? -


this question has answer here:

is example

using sportsstore.domain.entities; 

better this

using sportsstore; 

?

if case, mean performance of program when import bigger libraries?

edit: mean, pointless import stuff don´t use, there actual harm in doing so?

there no performance difference.

"a using-namespace-directive imports types contained in namespace enclosing compilation unit or namespace body, enabling identifier of each type used without qualification"

so using statement has no impact of when , how clr loads assembly. syntax can use types in cs file without full qualification.

the clr lazy loads assembly once type of assembly gets used first time (ex. if create instance of class, or if use static method etc).

so create new instance of type in "sportsstore.domain.entities", assembly gets loaded memory. there no partial loading of assemblies.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -