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

Managed C++/CLI

 
GeneralRe: Unexpected performance Pin
Mark Salsbery15-Oct-08 12:40
Mark Salsbery15-Oct-08 12:40 
GeneralRe: Unexpected performance Pin
Lutosław15-Oct-08 11:55
Lutosław15-Oct-08 11:55 
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 
Mark Salsbery wrote:
Lastly, don't believe people that say managed code is slower


Actually...this is exactly what we're finding.
Real world problem:
- MFC application, 1 EXE and 5 DLL's. The DLL's do all the computations and are highly optimized C++ code which have been validated for correctness and operation many times in the past decade. And we have spent many late nights finding performance gains - the code is good. The front-end is GUI. We have MFC, STL, ATL technologies incorporated, plus a lot of hand-written code - because STL was too slow. The DLL's implement linear algebra, various geometry calculations, and 1st-order PDE's. There are also simple array/table look-ups. The project is 300,000+ lines code.
- we also use ZLIB, GDAL/OGR, CGAL but they aren't used in these tests

Test results:
- baseline is current release build, test case taks 190seconds.
- simply turn on the /clr switch on as many files as possible (following the bouncing ball, trying to do it right) and performance drops to 345 seconds (not all could run managed because of MFC)
- retest native release build, it stays the same
- concerned we are doing too many native/managed swaps to translate 1 DLL to entirely a C++/CLI classlib, performance drops to 355 seconds. Confused so try it again, 361 seconds
- try NGEN on the classlib, performance becomes 349 seconds
- try NGEN on the entire project, performance becomes 476 seconds!
- back out of changes, start over with the native release build, back around 188 seconds
- incorporate the classlib and do MINIMUM required to get things to link back together (to use native as much as possible) and performance is around 244 seconds

All other test cases yield similar results.

We WANT to move to .Net (to clean up the code, make it easier to maintain and read, etc.), but we need a migratory path where we don't have to rewrite the entire front end out of MFC right away. But these performance #'s just suck. We can't ask the client to live with such poor performance during migration in hopes it will improve when it's all done and running strictly in managed. We have experience with C# in another project but are new in the C++/CLI world.

I'd happily discuss this online or offline but 'til then I can't agree with your comment at all Mark!

--Rob
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 
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 

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.