Click here to Skip to main content
13,090,418 members (52,316 online)

Welcome to the Lounge

   

For discussing anything related to a software developer's life. Technical discussions are encouraged, but click here to ask your programming questions.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.
 
NewsWinRT [C++/Cx to C#] performance Pin
Super Lloyd12-Feb-13 1:56
memberSuper Lloyd12-Feb-13 1:56 
Hi Folks,
Just to share some informal finding...
I'm writing (slowwwwwly) a DirectX WinRT binding: http://directwinrt.codeplex.com/[^]

I just implemented mouse picking (got to blog about it real soon!! ^^)

Anyway, I did some measurements...
In Sample1 I update 10.000 points in C#. It used to be a C++/CX IList/IVector.
Now I'm doing it in C# with pointers.
Updating 10K points in C# through C++/Cx took about 20.000 ticks
Updating it through pure C# (and pointers ) only took about 3.000 ticks.
Further tweaks were caching the pointer value (there was a method call to get the pointer) and avoid some casting reduced the time to 1.300 ticks.

Morale of the story: I was wondering about the performance of calling C++/Cx from C#?
Now I know: for intensive fine grained call into C++, it's still damn expensive!...
My programming get away... The Blog...
DirectX for WinRT/C# since 2013!
Taking over the world since 1371!

GeneralRe: WinRT [C++/Cx to C#] performance Pin
Dan Neely12-Feb-13 2:23
memberDan Neely12-Feb-13 2:23 
GeneralRe: WinRT [C++/Cx to C#] performance Pin
Super Lloyd12-Feb-13 2:38
memberSuper Lloyd12-Feb-13 2:38 
GeneralRe: WinRT [C++/Cx to C#] performance Pin
Rama Krishna Vavilala12-Feb-13 3:04
memberRama Krishna Vavilala12-Feb-13 3:04 
GeneralRe: WinRT [C++/Cx to C#] performance Pin
Nish Sivakumar12-Feb-13 3:18
sitebuilderNish Sivakumar12-Feb-13 3:18 
GeneralRe: WinRT [C++/Cx to C#] performance Pin
BillWoodruff14-Feb-13 20:04
memberBillWoodruff14-Feb-13 20:04 
GeneralRe: WinRT [C++/Cx to C#] performance Pin
Super Lloyd14-Feb-13 22:21
memberSuper Lloyd14-Feb-13 22:21 

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.


Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 19 Aug 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid