-3

I am currently cleaning up the code for my project and trying to improve its performance. As a part of improvement, I thought of removing unused "using" statements from all files. I would like to figure out if that would indeed improve the performance, so here is my question.

Through the "using" statement, is an external library/resource loaded when any method from the file is executed (READ: When file itself is loaded) OR the external library is loaded only when calling a specific method is actually using this library?

Vadzim Savenok
  • 930
  • 3
  • 14
  • 37
  • 3
    When you say "using statement" what you really mean is "using directive". A using statement is something entirely different. See this: http://stackoverflow.com/questions/6923493/what-is-the-difference-between-the-using-statement-and-directive-in-c – rory.ap Sep 19 '16 at 20:28

1 Answers1

2

The using statement is purely syntactic sugar; it lets you skip writing the namespace when using types in that namespace.

It has no effect whatsoever on the compiled IL or runtime performance.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964