Please help me to answer whether Comvisible-enabled attribute slows down .NET App?
+3
A:
No- ComVisibleAttribute is just an inert attribute until someone looks for it and then performs relevant acts in a context based on the metadata information stored in the custom attribute's serialized form.
Normal execution of a class is not impacted by the presence or absence of the attribute.
An example of something that looks for it is the regasm.exe tool - the more items you have marked ComVisible, the more will need to be registered / get registered / will get into the pool of registered stuff (in the Windows Registry in this instance) weighing down your system overall.
Ruben Bartelink
2010-06-16 00:20:19
Is calling comvisible-enabled .NET class from VB6 slower than from .NET app to .NET DLL?
Mark Attwood
2010-06-17 23:33:02
@markattwood: Sorry was OO last 2 days. That's a difficult question to answer quickly. In short, .NET to .NET is going to be a bit quicker as there is no interop layer between them - but you're not talking about orders of magnitude. Having said that, this is very much something that's intended to be fully supported and is in use in a variety of situations for all sorts of systems. But it depends - if you're doing a million iterations of a tight for-loop, it may indeed matter. So, to summarise - in general, there should not be a noticeable issue. But, it depends, and you aint given much context
Ruben Bartelink
2010-06-20 14:48:27
You should probably update your answer to include your comment
Chris Marisic
2010-07-22 16:23:04
@Chris Marisic: Thanks for the +1. Problem is that it's not directly related to the question at all - it's answering the question that Mark meant as opposed to asked. It'd be nice to hear back from @markattwood (i.e., accept and/or follow-up questions. Mark - people dont bother answering questions when people have 30%^ accept rates). I'm 100% happy for you to edit in a version of my comment into my answer. As it stands, my comment is a "well here are some more generalities, give me details and I can make it specific and not just a big It Depends".
Ruben Bartelink
2010-07-23 07:43:57