madhur wrote:
> 2. We have COM interfaces in ATL project so if we implement in C# do
> we have to write same thing to implement some basic functions like
> IUnknown etc..(please not we don't want to import using RCW)
If you want other code to use your COM objects (COM interfaces are
*always* part of a COM object) then you have no choice - you have to
implement COM object some way. In this situation I usually tell my
clients to leave the COM objects as COM objects. The .NET code can use
COM interop to access them. The reason is that if you've tested and
tuned them already for COM then you'll have to repeat all of that for
..NET. COM interop works, so use it.
If your objects will *only* be called by .NET objects then you do not
need COM. .NET objects can have interfaces. There's no equivalent of
IUnknown, because reference counting is not used, language casts are
used in place of QueryInterface. .NET interfaces also have inheritance.
In fact, interfaces in .NET make a lot of sense and can make your code
more polymorphic.
> 3. If we use VC8 instead of C# how much it will be better performance
> wise and migration effort wise, can u please suggest some ur ideas?
That is debateable. Think about the issues. You compile the code to IL
and then the IL just-in-time compiles the IL to x86 before the code is
run. The JIT compiler is common to *all* IL created by *every* language,
so language differences can only affect the IL that is generated. I've
looked at alot of IL produced by Microsoft's compilers and although
there are differences they are not significant in terms of performance.
So you choose the language according to the features it offers. C++
offers templates as well as generics and hence offers template
libraries. If you need those, then C++ is the way to go.
> The requirement is like that we have to migrate from existing C++ to
> Dotnet and then compare performance.
Well, I have done this with a Fast Fourier Transform and known test
data. (I used an FFT because it was computationally intensive.) I
compiled to unmanaged C++ with various optimizations (speed, size). Then
I made a few minor changes (mainly in array allocations and trig
function calls) and then recompiled as managed C++ with various
optimizations. For the same test data, with the JIT compile time
discarded, I found that managed C++ was marginally faster than unmanaged
C++. When you think about it, this makes sense because the JIT compiler
can be thought of as being the 'back end' of a conventional compiler. So
the output code should not be slower. Of course, the JIT compilation
does take time.
Richard
--
www.richardgrimes.com
my email
(E-Mail Removed) is encrypted with ROT13 (
www.rot13.org)