Re: Puzzling performance difference after refactor
Re: Puzzling performance difference after refactor
- Subject: Re: Puzzling performance difference after refactor
- From: Steve Checkoway <email@hidden>
- Date: Fri, 30 Jun 2006 13:52:26 -0700
On Jun 30, 2006, at 1:13 PM, Bill Monk wrote:
Sharking the hot loop for the two versions is interesting. In both,
of course, there's a function, let's call it A, which takes most
the time, since that's where the work is done. Function A calls B,
C, and D.
Shark shows that in the slow, multi-file app, function B is taking
44% of the time spent in A.
In the single-file, fast version, Shark shows that B is
statistically insignificant. There are lines near B which show
values as small as 0.1% in the Self column, but in the fast
version, B has no entry in the Self column.
Yet in the slow version, B shows 44%.
Without knowing what function B is nor how often it is called, one
thing comes to mind. Is B a small function that gets called many
times? If so, it's possible that when it was in the same file as A,
it was being inlined and if the function itself is short, it probably
doesn't take much time to execute. Without being able to inline the
function, you could be spending a large amount of time in the
function prologue/epilogue relative to the time spent in the function
body itself.
Have you tried moving the definition of B into the same file as A and
declaring it static? If so, how does that affect the run time?
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden