Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extension Methods: Performance issue when using too much? [duplicate]

Possible Duplicate:
Extension Method Performance

Will I face performance issues when I´m using extension methods too heavy in any way?

Just an example:

Lets say I´ve 100 extension methods on the type string and a business object that has 50 string properties. Now I create a collection of this business object, maybe 500 items?

Do these extension methods on string have any impact to RAM, CPU, ...?!

I really like extension methods but I´d like to know if there is a limitation concerning its usage.

like image 999
timmkrause Avatar asked Feb 09 '12 10:02

timmkrause


2 Answers

No you will not.

Extension methods are just normal static methods with some syntactic sugar. Use them as much as you want :)

like image 83
Alexey Raga Avatar answered Nov 12 '22 06:11

Alexey Raga


You might slow intellisense down in the IDE - and possibly make the intellisense lists a bit unwieldy, but it won't have any impact on the execution of the code itself over any other static method.

like image 5
Rob Levine Avatar answered Nov 12 '22 06:11

Rob Levine