C # 4.0 dynamic performance interacting with Office

I adopted an application that was developed in Visual Studio 2008 and used various Office libraries through COM Interop. I started some proof of concept development using the dynamic keyword and Visual Studio 2010. I found that doing the same tasks is about 5-10 times slower than dynamic than the "old" one. Has anyone else experienced this level of performance degradation? Is this known or should I find a way to report it?

+6
dynamic visual-studio-2010 office-interop
source share
1 answer

Yes, there is a known performance with the dynamic keyword. The reason for this is that it must insert values ​​into the object type and then use DLR (one-time) to compile and evaluate it. This will take more time on the processor than if this type were known. You can see the accepted answer to this question for a more detailed description.

Finally, in your case it will be even worse, because it is already a COM object, so boxing and unpacking this object on top of COM overhead will be exaggerated.

+1
source share

All Articles