Does the full namespace include slowdowns?

Is there any evidence that suggests including an entire namespace in C # slows down?

Is it better to do it

System.IO.Path.Combine....

Or include the entire System.IO namespace?

+3
source share
6 answers

It is much better to include the namespace in the statement usingat the top of your class. The compiler doesn't care. it will emit the same IL in both directions, and your code will be shorter and easier to read.

+16
source

No matter what, including the full namespace, it will not slow down the production code.

? , # , . - .

+3

... , .

+3

, , IDE , .

+1

Adding additional namespaces may affect the compilation time of your application. This is unlikely to be noticeable in most applications, but extremes can make it visible.

However, this does not affect the performance of your application at run time.

+1
source

No, the compiler is fast enough. Not sure what else I can add :)

0
source

Source: https://habr.com/ru/post/1723065/


All Articles