Re: minimizing the cost of managed/unmanaged collaboration
Alan Baljeu <[email protected]> Tue, 3 Apr 2007 14:53:01 -0400
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Message-ID | <02ab01c77621$4df1d080$1dc80ac6@CTI> |
> > Okay, so I have a tentative plan to convert significant > amounts of C++ > > into managed code, > > Sorry, I don't want to be annoying, but since you are writing > that you plan to convert significant amounts of code - do you > have a performance improvement plan that _needs_ this > conversion to be done? I have an objective, and general metrics, but not a plan. > I know that you currently have COM interfaces for the > interop, but converting them to C++ Interop or IJW (VC++ > 2005/2003) doesn't necessarily solve your performance > problems, because your parameters still need to be marshaled > with every cross-managed/unmanaged call. Actually what I'm planning will eliminate some of the crossover, so there will be 1/2 the data marshalling and many fewer marshalled calls. > And even if COM is your culprit, converting your code to > unmanaged DLLs and consume them from C# via P/Invoke might > require much less work, although only you can estimate this. Understood. > Therefore - before rewriting everything, you might want to > look at the monitoring stuff in the article I mentioned, > maybe you can find out the actual reason for your performance > problems. Or, if these don't help you at all, at least try > out this rewrite on some small portion of code to measure the > benefits. Unless you are really sure that rewriting will pay off. Good advice. I didn't find too much helpful for monitoring. I retrieved that CLR Spy but it seems to just report bad interop activities; I don't see any performance indicators. I will definitely try simple changes first before diving headlong into massive changes. Alan =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com