Profiling was "Re: [sldev] Multithreading, Garbage collection, Caching"

Laurent Laborde kerdezixe at gmail.com
Sun Mar 18 15:49:31 PDT 2007


On 3/18/07, Laurent Laborde <kerdezixe at gmail.com> wrote:
> Just switched to First Look, and yes, it's multi-threaded :)
> I Run a mac book pro, dual core 2.16Ghz with ATI X1600, 256MB

Quicktime isn't on a separate thread.
So i just sat in front of a movie screen in a busy sim, pressed play
and sampled 60s in my profiler.

Around 25 FPS (stats from the ingame tool).

0.6% of total cpu time is spent in Quicktime, precisely :
LLMediaImplQuickTime::updateMedia ()
   |-- MCIdle(theController);

So, for 0;6% .... bleh :)

BUT ! I ran another test, i pressed play before everything load, the
movie screen shown just a black texture, something was wrong (movie
not playing correctly) AND the MCIdle function took around 40% of the
CPU Time.

I'm not sure MCIdle should be called just like it is actually.
And the current implementation don't do much error checking.

From ADC :

Applications give time to QuickTime by calling the MCIdle, MoviesTask,
or MCIsPlayerEvent APIs. However, how often to call these APIs was
always a question with a seemingly non-determinate answer. In many
cases, applications idle more frequently than is required or when
QuickTime doesn�t really need to be called making inefficient use of
processor time.

There are three APIs available to improve QuickTime tasking from an
application�s point of view. These are QTGetTimeUntilNextTask,
QTInstallNextTaskNeededSoonerCallback and
QTUninstallNextTaskNeededSoonerCallback.

A callback is also installed using the
QTInstallNextTaskNeededSoonerCallback API so if QuickTime decides that
it requires time immediately it will call the
QTInstallNextTaskNeededSoonerCallback routine

QTGetTimeUntilNextTask
Provides the time in specified units, until QuickTime next needs to be called.
This routine takes the scale that you�re interested in, whether it is
a 60th of second (scale=60), or a 1000th of second (scale=1000) then
returns a duration that specifies how long you can wait before tasking
QuickTime again.

-- 
Kerunix Flan


More information about the SLDev mailing list