Type casting performance …

Lately I wondered performance on different type cast, es:

  • MyClass myObj = (MyClass)genericObj;
  • MyClass myObj = genericObj as MyClass;
  • genericObj is MyClass

I already knew that IS clause is the slower.
If you want go deeper about boxing ‘n unboxing, please read MSDN:
Boxing and Unboxing
Performance

Have a nice reading. 😉

PS: you may have a look also here Type casting impact over execution performance in C#Perfomance of TypeCasting, and Type Casting in C#.
I’ll have a deep read too. 😉

Advertisements

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: