Click here to Skip to main content
15,885,984 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Unexpected performance Pin
Mark Salsbery15-Oct-08 11:12
Mark Salsbery15-Oct-08 11:12 
GeneralRe: Unexpected performance Pin
Lutosław15-Oct-08 12:05
Lutosław15-Oct-08 12:05 
GeneralRe: Unexpected performance Pin
Mark Salsbery15-Oct-08 12:38
Mark Salsbery15-Oct-08 12:38 
GeneralRe: Unexpected performance Pin
Lutosław16-Oct-08 4:43
Lutosław16-Oct-08 4:43 
GeneralRe: Unexpected performance Pin
Mark Salsbery16-Oct-08 4:48
Mark Salsbery16-Oct-08 4:48 
GeneralRe: Managed code *is* slower Pin
Rob Bryce20-Oct-08 5:50
Rob Bryce20-Oct-08 5:50 
GeneralRe: Managed code *is* slower Pin
Mark Salsbery20-Oct-08 6:10
Mark Salsbery20-Oct-08 6:10 
GeneralRe: Managed code *is* slower Pin
Rob Bryce22-Oct-08 6:53
Rob Bryce22-Oct-08 6:53 
Mark Salsbery wrote:
I certainly wouldn't do that. C++/CLI is meant to be a bridge from
native C++ to the managed .NET world. It should be used as that.
Use the #pragma managed/#pragma unmanaged macros to control what code gets
compiled managed and what stays native. Then you can keep your optimized or
performance critical code compiled native. This can be done at the function level!


Hi Mark,

I took your advice and created a new configuration in the project. Here, everything possible is native C++, and we're only using C++/CLI to provide the interface to one (previously COM) DLL. It was the easiest to use because it was the simplest. Plus it's used through-out the project quite a bit. Calculations are simple and quick. Another way to state this is we did nothing but change the interface technology from COM to .Net/managed on 1 DLL.

We observed a performance impact of about 35% by just doing this change! WTF | :WTF: So we then put that entire DLL into CLR and the performance did improve - impact was around 23%. So in this instance the cost of switching from native->managed->native out-weighed the cost of executing the DLL code all as managed. But it's still a big hit from native C++.

These #'s were surprising, to say the least...but are consistent with some tests we did about a year ago. One advantage of doing this exercise, though, was finidng some compiler options that needed to be changed, which improved the baseline performance (strictly C++). The above performance impact %-ages do not consider those gains, though. OMG | :OMG:

I'm not posting this to beat a dead horse, but am opening up this discussion to look for things we may have missed during our testing.Confused | :confused:

--Rob
GeneralRe: Managed code *is* slower Pin
Mark Salsbery22-Oct-08 7:39
Mark Salsbery22-Oct-08 7:39 
GeneralRe: Managed code *is* slower Pin
led mike21-Oct-08 4:46
led mike21-Oct-08 4:46 
GeneralRe: Managed code *is* slower Pin
Rob Bryce21-Oct-08 5:31
Rob Bryce21-Oct-08 5:31 
GeneralRe: Managed code *is* slower Pin
led mike21-Oct-08 7:01
led mike21-Oct-08 7:01 
GeneralRe: Managed code *is* slower Pin
Rob Bryce21-Oct-08 8:44
Rob Bryce21-Oct-08 8:44 
QuestionUnmanaged C++ code in managed env error(only framework installled) Pin
balu1234513-Oct-08 21:44
balu1234513-Oct-08 21:44 
AnswerRe: Unmanaged C++ code in managed env error(only framework installled) Pin
Mark Salsbery14-Oct-08 4:09
Mark Salsbery14-Oct-08 4:09 
GeneralRe: Unmanaged C++ code in managed env error(only framework installled) Pin
balu1234514-Oct-08 6:50
balu1234514-Oct-08 6:50 
GeneralRe: Unmanaged C++ code in managed env error(only framework installled) Pin
Mark Salsbery14-Oct-08 7:15
Mark Salsbery14-Oct-08 7:15 
GeneralYou missed one Pin
led mike14-Oct-08 8:05
led mike14-Oct-08 8:05 
GeneralRe: You missed one Pin
Mark Salsbery14-Oct-08 8:12
Mark Salsbery14-Oct-08 8:12 
Questionhelp needed.. STL Pin
wyl8613-Oct-08 0:40
wyl8613-Oct-08 0:40 
GeneralRe: help needed.. STL Pin
George L. Jackson13-Oct-08 4:28
George L. Jackson13-Oct-08 4:28 
QuestionNumber of controls on the Form. Pin
mikobi12-Oct-08 20:31
mikobi12-Oct-08 20:31 
AnswerRe: Number of controls on the Form. Pin
Lutosław15-Oct-08 12:17
Lutosław15-Oct-08 12:17 
QuestionSplitter, "OnSize strikes back !" Pin
CrocodileBuck11-Oct-08 1:00
CrocodileBuck11-Oct-08 1:00 
AnswerRe: Splitter, "OnSize strikes back !" Pin
Mark Salsbery11-Oct-08 6:27
Mark Salsbery11-Oct-08 6:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.