Performance of: if (OBJECT_INSTANCE is TYPE)
- by Axonn
I am working both in C# and ActionScript 3. Both language are type-aware, so you can do verifications such as:
if (some_object_instance is SomeClassName_ThatIs_SomeType)
I'm doing these kind of verifications in a few places. Might be a dumb question, but I will ask it anyway, and I want answers from both camps, C# and ActionScript:
What goes on behind the scenes? Is it Reflection? If is, isn't this a long verification which might degrade performance if done in thousands of loops? And by "degrade performance" I mean, is it more intensive than say if (Math.sqrt(8) > Math.sin(10))