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: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 16 Jan 2009 12:04:36 +0100
Le 16 janv. 09 à 11:19, Jens Bauer a écrit :
Hi Jean-Daniel,
On Jan 16, 2009, at 09:32, Jean-Daniel Dupas wrote:
You don't want to understand.
I'm sorry, if it appears to be like I do not want to understand.
I've been working all night on this, and I'm quite sleepy right now.
My results after changing to plain C are much better. My conclusion
is based upon what I can see as results, they may still be wrong.
You CANNOT mesure elapsed time for ONE call. You have to bench
thousand of call in one loop and take an average time.
Yes and no. It depends on what the purpose is.
To see an average value, you'll have to do just that, however, in my
case, to discover when/why the chops happen, I did this - initially
because I thought that my code sometimes was to blame.
You first conclusion IS WRONG and it does not depend if you have 20
threads or only one. Your PEAK VALUE is WRONG too. It's not
possible to mesure a peak value, especially in a preemptive
environment.
You're right about that, and I agree to a certain point.
My rendering is pretty quick (it's using highly optimized code and
already prepared data).
When the code I have is using a lot of ObjC invocations, it appears
to me that it's more likely to be hit, than when it doesn't.
-Both in theory, and when I look at the result.
The only way I can explain that it works better with clean C (apart
from superstitious explanations), is that something that happens in
the message dispatcher, is not happening anymore.
I've tried debugging into the message-dispatcher, however I failed
to coninue at some point, which is expected (I've written debuggers
in the past as well).
I'm using An Obj-C based library to render two 1080p movies into an
OpenGL context, applying shaders and more.
I'm using the QTKit which are objc classes and a core video display
link.
The display link callback call an obj-c method to render the each frame.
The rendering method use a dictionary to manage the movie it should
draw. Each movie use an objc class to managed it's visual context.
The renderer send messages to each movies, that send messages to each
visual context to find updated frames.
Then it delegate the rendering part to an other class.
The real renderer retreive the new frames using objc methods, it setup
OpenGL shader wrap into ObjC classes using objc methods.
It enable them using other ObjC method call.
And there is a lot of other messages to setup wrapper OpenGL frame
buffer, to draw reflection, and more.
That's make a lots of message for each frame rendering and I don't see
any glitch so, I doubt the problem is in the obj-c runtime.
_______________________________________________
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