By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,502 Members | 1,159 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,502 IT Pros & Developers. It's quick & easy.

Profiling .NET?

P: n/a
I'm especially hoping Ben Voigt and/or Bob Powell see this (I saw their
names on the m.p.d.f.performance newsgroup :) )

I would have posted to the performance newsgroup, but I see very little on
there that actually seems to relate to the _tools_ per se while this
newsgroup is actually somewhat related to the tools, and most of the
useful answers come from people known to frequent this newsgroup anyway,
so... :)

My basic question: I am trying to get better data as to why a particular
scenario of calling Graphics.DrawImage() is so slow. Is there an
instrumented version of the .NET run-time that can be used for
instrumented profiling? Alternatively, does anyone have advice as to how
to get sampled profiling working on VS2008? (In theory, sampled profiling
would work with the regular .NET DLLs, since I can get symbols for those).

On the latter point, I thought it should "just work". But when I try to
do it, VS prompts me to see if I want to upgrade my permissions (I running
as non-admin, as I always do), I say yes and provide user/password for the
administrator account, at which point VS emits some non-descript errors
("can't profile") in the Output window, and then freezes. After that
(even if I terminate the VS process), I cannot use VS for any profiling
(even instrumented, which normally works fine) without restarting the
computer.

The more specific issue is this: a friend of mine uncovered a scenario in
which applying a certain Matrix to the Graphics.Transform property results
in abysmal performance. The weird part (as it that weren't enough) is
that the transformation being used is a scaling of exactly -1 in the
horizontal direction. If we change the scaling to be just slightly
greater than -1 (e.g. -0.9999), performance approximately doubles and if
we change it to be just slightly less than -1 (e.g. -1.0001), performance
is basically on par with the completely unscaled performance (approx 10x
better than the slowest case).

This makes no sense to either of us, and I was hoping to be able to use
the profiling tools to understand better what is costing so much
computationally in that particular scenario, and why that cost isn't
incurred in theoretically more difficult scenarios. But the only
profiling I've gotten to work so far only produces data for my own code,
and tells me that the vast majority of the time spend in the application
is in the Graphics.DrawImage() method. But I already pretty much knew
that. :) I want to know _what_ in that method is taking so long.

Any advice on either aspect of this question?

Pete
Jun 27 '08 #1
Share this Question
Share on Google+
9 Replies


P: n/a
On Jun 5, 5:36 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
I'm especially hoping Ben Voigt and/or Bob Powell see this (I saw their
names on the m.p.d.f.performance newsgroup :) )

I would have posted to the performance newsgroup, but I see very little on
there that actually seems to relate to the _tools_ per se while this
newsgroup is actually somewhat related to the tools, and most of the
useful answers come from people known to frequent this newsgroup anyway,
so... :)

My basic question: I am trying to get better data as to why a particular
scenario of calling Graphics.DrawImage() is so slow. Is there an
instrumented version of the .NET run-time that can be used for
instrumented profiling? Alternatively, does anyone have advice as to how
to get sampled profiling working on VS2008? (In theory, sampled profiling
would work with the regular .NET DLLs, since I can get symbols for those).

On the latter point, I thought it should "just work". But when I try to
do it, VS prompts me to see if I want to upgrade my permissions (I running
as non-admin, as I always do), I say yes and provide user/password for the
administrator account, at which point VS emits some non-descript errors
("can't profile") in the Output window, and then freezes. After that
(even if I terminate the VS process), I cannot use VS for any profiling
(even instrumented, which normally works fine) without restarting the
computer.

The more specific issue is this: a friend of mine uncovered a scenario in
which applying a certain Matrix to the Graphics.Transform property results
in abysmal performance. The weird part (as it that weren't enough) is
that the transformation being used is a scaling of exactly -1 in the
horizontal direction. If we change the scaling to be just slightly
greater than -1 (e.g. -0.9999), performance approximately doubles and if
we change it to be just slightly less than -1 (e.g. -1.0001), performance
is basically on par with the completely unscaled performance (approx 10x
better than the slowest case).

This makes no sense to either of us, and I was hoping to be able to use
the profiling tools to understand better what is costing so much
computationally in that particular scenario, and why that cost isn't
incurred in theoretically more difficult scenarios. But the only
profiling I've gotten to work so far only produces data for my own code,
and tells me that the vast majority of the time spend in the application
is in the Graphics.DrawImage() method. But I already pretty much knew
that. :) I want to know _what_ in that method is taking so long.

Any advice on either aspect of this question?

Pete
I have used red gates antz profiler. It gives your line and function
wise execution time.. Evaluation version..
Jun 27 '08 #2

P: n/a
On Thu, 05 Jun 2008 15:41:30 -0700, parez <ps*****@gmail.comwrote:
I have used red gates antz profiler. It gives your line and function
wise execution time.. Evaluation version..
I don't need _my_ line- and function-wise execution time. :) The VS
profiler does that too, and it works fine. I want the .NET information.

Does the Antz profiler provide profile information for execution within
..NET itself? If so, what prerequisites, if any, exist (other than having
the profiler itself, of course)?

Pete
Jun 27 '08 #3

P: n/a
Profiling in Visual Studio??? Where? When? Why?...... something tells me
that this is a Team edition thing and not available in the professional
version,is t?…. Damn it.
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
I'm especially hoping Ben Voigt and/or Bob Powell see this (I saw their
names on the m.p.d.f.performance newsgroup :) )

I would have posted to the performance newsgroup, but I see very little on
there that actually seems to relate to the _tools_ per se while this
newsgroup is actually somewhat related to the tools, and most of the
useful answers come from people known to frequent this newsgroup anyway,
so... :)

My basic question: I am trying to get better data as to why a particular
scenario of calling Graphics.DrawImage() is so slow. Is there an
instrumented version of the .NET run-time that can be used for
instrumented profiling? Alternatively, does anyone have advice as to how
to get sampled profiling working on VS2008? (In theory, sampled profiling
would work with the regular .NET DLLs, since I can get symbols for those).

On the latter point, I thought it should "just work". But when I try to
do it, VS prompts me to see if I want to upgrade my permissions (I running
as non-admin, as I always do), I say yes and provide user/password for the
administrator account, at which point VS emits some non-descript errors
("can't profile") in the Output window, and then freezes. After that
(even if I terminate the VS process), I cannot use VS for any profiling
(even instrumented, which normally works fine) without restarting the
computer.

The more specific issue is this: a friend of mine uncovered a scenario in
which applying a certain Matrix to the Graphics.Transform property results
in abysmal performance. The weird part (as it that weren't enough) is
that the transformation being used is a scaling of exactly -1 in the
horizontal direction. If we change the scaling to be just slightly
greater than -1 (e.g. -0.9999), performance approximately doubles and if
we change it to be just slightly less than -1 (e.g. -1.0001), performance
is basically on par with the completely unscaled performance (approx 10x
better than the slowest case).

This makes no sense to either of us, and I was hoping to be able to use
the profiling tools to understand better what is costing so much
computationally in that particular scenario, and why that cost isn't
incurred in theoretically more difficult scenarios. But the only
profiling I've gotten to work so far only produces data for my own code,
and tells me that the vast majority of the time spend in the application
is in the Graphics.DrawImage() method. But I already pretty much knew
that. :) I want to know _what_ in that method is taking so long.

Any advice on either aspect of this question?

Pete
Jun 27 '08 #4

P: n/a
On Thu, 05 Jun 2008 17:23:46 -0700, Rene <a@b.comwrote:
Profiling in Visual Studio??? Where? When? Why?...... something tells me
that this is a Team edition thing and not available in the professional
version,is t?…. Damn it.
Yes, sorry. Personally, I think _some_ kind of profiling ought to be in
the Pro version, even if it's dumbed down a bit.

But yes, you have to have the Team version to get profiling features. :(

Now if only I could get it to work.

Pete
Jun 27 '08 #5

P: n/a
On Jun 5, 7:14 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Thu, 05 Jun 2008 15:41:30 -0700, parez <psaw...@gmail.comwrote:
I have used red gates antz profiler. It gives your line and function
wise execution time.. Evaluation version..

I don't need _my_ line- and function-wise execution time. :) The VS
profiler does that too, and it works fine. I want the .NET information.

Does the Antz profiler provide profile information for execution within
.NET itself? If so, what prerequisites, if any, exist (other than having
the profiler itself, of course)?

Pete
My evaluation version has expired. What i remember is that, i found it
more useful than the vs profiler.
Check out this link

http://www.red-gate.com/Products/ant...ugh1/step5.htm

see if that is what you want it to do.
Jun 27 '08 #6

P: n/a
I just had a quick look at mine and it if you switch the right option on
("All .NET methods") in a detailed performance profile it seems to give you
everything. Except source code of course :-)

Adam.

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Thu, 05 Jun 2008 15:41:30 -0700, parez <ps*****@gmail.comwrote:
>I have used red gates antz profiler. It gives your line and function
wise execution time.. Evaluation version..

I don't need _my_ line- and function-wise execution time. :) The VS
profiler does that too, and it works fine. I want the .NET information.

Does the Antz profiler provide profile information for execution within
.NET itself? If so, what prerequisites, if any, exist (other than having
the profiler itself, of course)?

Pete

Jun 27 '08 #7

P: n/a
First, how large is your image? If it is small enough to fit in the
memory on your graphics card then I suggest you bite the bullet and
upgrade to WPF. Your image transforms will run on the GPU if you do
that. It should give you much more consistent and speedy results.
Remember nobody has fixed any bugs with MS's GDI+ since 2003.
Actually, you may have better luck with Mono's GDI+ as it is still
actively developed.
Jun 27 '08 #8

P: n/a
On Fri, 06 Jun 2008 07:25:52 -0700, Adam Benson
<Ad*********@NOSPAMMYSPAM.omnibus.co.ukwrote:
I just had a quick look at mine and it if you switch the right option on
("All .NET methods") in a detailed performance profile it seems to give
you
everything. Except source code of course :-)
Okay...thanks, both of you.

If I get some time, I'll check out the evaluation version and see if it
seems more helpful.

Pete
Jun 27 '08 #9

P: n/a
On Fri, 06 Jun 2008 07:30:35 -0700, not_a_commie <no********@gmail.com>
wrote:
First, how large is your image? If it is small enough to fit in the
memory on your graphics card then I suggest you bite the bullet and
upgrade to WPF.
Good point. I'm sure it is small enough. I'm already intending to test
the scenario in unmanaged code, to see whether this is a .NET thing or a
GDI thing. Not sure if I'll bother trying GDI+ with unmanaged code, but
it might be worthwhile to explore a WPF test to see if it improves things.

Thanks for the suggestion.

Pete
Jun 27 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.