An extremely weird slowness...
An extremely weird slowness...
- Subject: An extremely weird slowness...
- From: Ondra Cada <email@hidden>
- Date: Mon, 21 Nov 2005 12:21:02 +0100
Hello all,
I've got a slow code, and I fear I have no idea what the heck might
be causing the problem. I've found the loop which takes an eternity;
it looks like this:
for (NSEnumerator *en=[scheduledToSetCurrentLock
objectEnumerator];dbo=val2id([en nextObject]);) {
DBXLock *lock=[DBXLock currentLockFor:dbo];
[dbo setCurrentLock:lock];
NSLog(@"has returned");
}
The one method which is interesting is the setCurrentLock: one; it
looks like this:
-(void)setCurrentLock:(DBXLock*)lock {
currentLock=lock; // no need to retain here
NSLog(@"about to return");
}
Now, the log shows pretty well where all the time goes to:
...
2005-11-21 11:13:02.585 AdnexusII[1095] about to return
2005-11-21 11:13:03.376 AdnexusII[1095] has returned
2005-11-21 11:13:03.387 AdnexusII[1095] about to return
2005-11-21 11:13:03.878 AdnexusII[1095] has returned
2005-11-21 11:13:03.897 AdnexusII[1095] about to return
2005-11-21 11:13:04.300 AdnexusII[1095] has returned
2005-11-21 11:13:04.316 AdnexusII[1095] about to return
2005-11-21 11:13:04.876 AdnexusII[1095] has returned
2005-11-21 11:13:04.886 AdnexusII[1095] about to return
2005-11-21 11:13:05.420 AdnexusII[1095] has returned
2005-11-21 11:13:05.432 AdnexusII[1095] about to return
2005-11-21 11:13:06.127 AdnexusII[1095] has returned
...
WTH?!? How comes that a plain ole return takes nearly a second? Had
it been a message dispatch, well, I dunno, selector caches might go
wild or whatever, but this I plain don't get :-O Far as I can say,
the rest of the application works normally -- I haven't encountered
anything like that elsewhere.
I have checked the assembly code, of course. Did not help any, looks
perfectly normal to me -- here's the end of the setCurrentLock: method:
...
0x00017968 <+0064> bl 0x72160 <dyld_stub_NSLog> // NSLog
(@"about to return");
0x0001796c <+0068> lwz r1,0(r1)
0x00017970 <+0072> lwz r0,8(r1)
0x00017974 <+0076> mtlr r0
0x00017978 <+0080> lmw r30,-8(r1)
0x0001797c <+0084> blr // I've even traced to be sure--indeed
skips directly... (*)
// this is the appropriate part of the loop
...
0x0002e95c <+0228> bl 0x720a0 <dyld_stub_objc_msgSend> // [dbo
setCurrentLock:lock];
0x0002e960 <+0232> addis r2,r31,5 //
(*) ... here
0x0002e964 <+0236> addi r0,r2,24940
0x0002e968 <+0240> mr r3,r0
0x0002e96c <+0244> bl 0x72160 <dyld_stub_NSLog> // NSLog
(@"has returned");
...
Well perhaps I am overlooking something pretty obvious, dunno. Will
be very grateful for any help how to find the cause.
(Caching IMPs -- luckily, there happen to be only two possible
classes for "dbo" in this case, so it is comparatively easy --
happens to help, so I can fix the problem. Still, I *very much*
wonder what may be the blasted cause?!?)
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden