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: Mon, 5 Feb 2007 15:14:51 -0800
On Feb 3, 2007, at 1:12 PM, John Daniel wrote:
This is exactly what I had been doing, but I didn't notice any bad
behavior. You might be doing things intense enough to cause
something bad. It is easy enough to fix. Add an empty method and
detach it in a new NSThread before anything else in your app gets
started.
Great catch, and something I definitely should have been doing--but
still no luck. When I add that and remove other code to keep the code
section the same size, it's still slow.
At this point, I'm not changing the running code at all: simply
adding an unused function makes select() run faster.
Finally, have you recompiled sqlite with the same compiler and
settings that you are using for your app? This could cause nasty
problems too.
Same compiler, gcc 4.0.1. I'm not using any unusual in the Xcode
build settings and I'm using a Makefile from sqilte's configure
script, so I'd expect everything to work there. I haven't tried
copying the Xcode compile flags into the sqlite Makefile.
In general, I think that if you are stuffing no-ops into the binary
executable data, you are looking in the wrong place. It is probably
something more basic than that.
I sure hope so. I've been playing with this more, and the only thing
that seems to correlate with the slowdown is the code section offset.
I've added a bit of code to fix some other bugs, and if I add padding
to get the offset back to the old value, it slows down again.
Here's two builds, one that does "slow" selects, and one that's
"fixed", and their corresponding Time Profile samples (for what
that's worth):
http://www.panic.com/~dave/Unison-good.app.zip
http://www.panic.com/~dave/Unison-good.mshark
http://www.panic.com/~dave/Unison-bad.app.zip
http://www.panic.com/~dave/Unison-bad.mshark
Again, the only difference between the two is a function that's never
called:
@implementation PaddingCode
- (void)padding
{
}
@end
If anyone is willing to dig into this and needs a usenet account for
testing, please email me and I'll set something up.
-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