Re: ObjC in time-critical parts of the code
Re: ObjC in time-critical parts of the code
- Subject: Re: ObjC in time-critical parts of the code
- From: Jens Bauer <email@hidden>
- Date: Fri, 16 Jan 2009 09:27:51 +0100
Hi Greg,
On Jan 16, 2009, at 08:39, Greg Titus wrote:
The point of what people are trying to tell you is that the result
you are getting (3ms per empty Objective-C call) is approximately
500,000 times longer than the time you ought to be getting (5-6ns).
If an Objective-C message send took 3 milliseconds (333 method calls
per second!), no useful software could ever have been written in the
language.
Just a comment.. It's not every invocation of the empty method that
takes 3ms, it's just happening often.
What I'm concerned about, is the peak values, that makes chops in my
rendering. I thought it was the fault of my rendering code, and it did
take me some time to figure out that it wasn't *inside* my rendering,
but *outside* it, that the time was spent.
From your guess at the end of your post, ("message dispatcher
servicing") it is pretty clear that you don't really know what is
going on.
:) I don't think any of us (except from Apple) knows what's exactly
going on in there. ;)
Blaming the language environment for performance behavior that is
vastly different than any of the rest of us have ever seen is not
likely to be useful to you at all. There is something else happening
with your application.
Uhm... Just to be stubborn: I changed the rendering to use plain C-
routines, and now it doesn't get those high peak values anymore, and
the chopping is gone.
Yes, it's still an assumption, that this fixed it. I will try and see
if it continues to work, but it definitely seems so much better right
now.
We're just trying to save you the effort of rewriting and then
discovering that nothing about the timing problem has changed,
because you have misidentified the problem.
I know. -But I had to get rid of the chopping, and I couldn't find any
other possibilities than to time my program.
Fortunately, it didn't take as long to rewrite, as I first expected.
I haven't noticed any lags of this kind before, which means that high
peak impacts are probably not happening in general.
-I just got shocked, when I saw the results. It could be because I'm
not supposed to use ObjC-code in a CVDisplayLink callback function.
Good luck,
Thanks. :)
Love,
Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden