using keyword and code performance

  • Thread starter Thread starter Phl
  • Start date Start date
P

Phl

hello,

is it important to only reference the component you need at the start
of your c# code. would excessive reference degrade your performance?

the answer is probably obvious but just looking for a tech
explanation.

cheers
 
Phl said:
is it important to only reference the component you need at the start
of your c# code. would excessive reference degrade your performance?

No. There's no difference to the compiled code between using the
"using" directive and referencing each type with the full namespace.
 
I guess it will help the compiler speed up things slightly, as it
doesn't need to scan through the imported namespaces to see which one
has a particular type. Only a guess though..

Regards
Senthil
 
sadhu said:
I guess it will help the compiler speed up things slightly, as it
doesn't need to scan through the imported namespaces to see which one
has a particular type. Only a guess though..

It only makes a difference to performance at compile-time. The
generated code is identical.
 
Back
Top