Re: Bizarre x86 segment layout problem causing select() slowdown
Re: Bizarre x86 segment layout problem causing select() slowdown
- Subject: Re: Bizarre x86 segment layout problem causing select() slowdown
- From: Dave Hayden <email@hidden>
- Date: Tue, 6 Feb 2007 15:00:38 -0800
On Feb 5, 2007, at 8:11 PM, Shawn Erickson wrote:
On Feb 5, 2007, at 7:20 PM, John Daniel wrote:
One thing you might try instead of Shark is Thread Viewer. It is
still a sampler-type tool, but you can pause your program and see
where each thread is and has been (relative to the sampling, of
course). I have used Thread Viewer and have gotten meaningful
results from it.
Shark.app has a more capable version of Thread Viewer if you use
system trace mode.
<http://developer.apple.com/tools/performance/
optimizingwithsystemtrace.html>
Very cool! I'll have to try to keep myself from swatting flies with
this sledgehammer. :)
So here's what I think the system trace is telling me: in the "good"
build, select() turns around in around 2ms and the following read()
usually returns 1448 bytes; in the "bad" build, select() averages
around 30ms and the read() yields 583 bytes. No idea why for the
difference. But the libSystem.select codepath seems to be different
according to the System Calls view. In the good build:
Self Total Library Symbol
0.0% 59.4% libSystem.B.dylib select
0.1% 0.1% BSD read
59.2% 59.2% Mach mk_timer_arm
0.2% 0.2% BSD lseek
versus the bad:
Self Total Library Symbol
0.0% 70.5% libSystem.B.dylib select
70.2% 70.2% BSD select
0.1% 0.1% MIG Message vm_allocate
0.1% 0.1% BSD read
0.0% 0.0% BSD lseek
Maybe I'm reading that wrong, or maybe it's just a consequence of
something else, but it seems weird.
For the curious, here's the system trace files (~10MB total):
http://www.panic.com/~dave/systrace-bad.mshark
http://www.panic.com/~dave/systrace-good.mshark
These have just one worker thread running to make things clearer.
And for anyone turned off by my previous messing about in _asm land,
there's none of that here--the only difference between these two
builds is an empty function that's never called.
Fingers crossed that someone can shed some light on this,
-Dave
_______________________________________________
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