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.
I want to know how she could afford to drink 10 litres of Coke per day? It is about £1 per litre in UK supermarkets, so that works out at £70 per week. Presumably with 8 kids and health problems she was not working - did she spend all of the family allowance on Coke?
It's well known that if all the cat videos and porn disappeared from the internet there would be only one site left and it would be called whereareallthecatvideosandporn.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!...
Ouch. Were you using p/invoke or whatever they're calling C++.net these days (I can never remember what its current versions name is)? The latter was intended to be a high performance bridge between managed and unmanaged code.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt
The new version of interop between C++ and .NET in WinRT/Windows is: C++/CX, it's an improved COM bridge they say (it's probably true! at least it's quite pleasant to use!! )
Anyway, yes, I am using that. But it was fine grained. I had an IList<T> which was native and I was setting 10.000 of them.
To be fair I didn't use the (C++) Vector<T> but my own implementation of IVector<T> (as I need to do something with the data pointer in C++). Come to think of it there might be a (non obvious) problem with my class... maybe the underlying std::vector<T> is slow?!?
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.
Hi Super LLoyd,
Assuming no structural problems in your code doing this either way: I'm curious what inference you might make from this observation: better to code in C# and use pointers ?
“Thus on many occasions man divides himself into two persons, one who tries to fool the other, while a third, who in fact is the same as the other two, is filled with wonder at this confusion. Thinking becomes dramatic, and acts out the most complicated plots within itself, and, spectator, again, and again, becomes: actor.” From a book by the Danish writer, Paul Moller, which was a favorite of Niels Bohr.