Re: Performance Question C++/CLI
- From: "Shawn B." <leabre@xxxxxxxx>
- Date: Fri, 3 Mar 2006 10:23:20 -0800
Hi,
I would like to give you a definite answer, but in the situation that you
describe, it all depends on the managed to unmanaged interation.
making the transition carries a certain overhead. If your native code is
faster than the managed code, this means that you can have n transitions
per second and be break even in performance.
if there are less than n transitions per second, you win. if there are
more, you lose.
The actual number depends on so many factors that there really is no other
way then to run some real performance tests.
I have seen situations where I won a serious performance gain. This was in
situations where some serious pointer arithmetic was done on large data
sets. We won because it was a large block of work that needed only 2
transitions to get it done.
I have also seen the opposite happen. It all depends on the amount of time
you win by going native versus the amount of time you lose by making the
transitions.
The CPU will spend the majority of its time operating on its own internall
memory structures. Only occasionally will it need to transition between
managed/unmanaged. I think, if you're typing, you can only type about 8
characters a second most of the time, so that's 8 transitions, meanwhile,
its executing 1 million instructions per second in its loop that aren't
transitioning. I don't have to make a callback when a graphics or text area
is updated with a new pixel or text character... if I'm refreshing the pages
50 times a second then the timer will handle it. It'll probly work out
pretty well in the end.
Thanks,
Shawn
.
- References:
- Performance Question C++/CLI
- From: Shawn B.
- Re: Performance Question C++/CLI
- From: Bruno van Dooren
- Performance Question C++/CLI
- Prev by Date: Re: pin_ptr causes compiler crash
- Next by Date: wchar_t string literal depends on source file type?
- Previous by thread: Re: Performance Question C++/CLI
- Next by thread: Help for me:LNK2019
- Index(es):
Relevant Pages
|