Re: Re: AU processor load
Re: Re: AU processor load
- Subject: Re: Re: AU processor load
- From: Ian Kemmish <email@hidden>
- Date: Tue, 27 Jan 2009 08:38:59 +0000
On Mon, 26 Jan 2009, at 23:01:12 Jens Alfke wrote:
On Jan 26, 2009, at 9:47 PM, Walt wrote:
In your process frames code, record the system time on entry/exit.
Starting with the second buffer processed, you know how much time
you took to process buffer N-1, and can derive how much time was
spent outside of your processing by looking at the exit time of the
previous buffer.
That assumes that (a) your processing code is the only part of the
chain using up any CPU, and that (b) your code will never get blocked
or pre-empted by another task. I don't think either of those are
necessarily true.
Yes, but on the other hand, you were originally asking about getting a
figure to report to the user, not a getting a figure for benchmarking
or tuning purposes. If something is interfering with your AU, then
the user will probably be happier to see that reflected in your load
meter than not. (Happiest of all to see both readings, of course!)
My synthesiser uses lazy evaluation a lot, so the load goes up and
down like a yo-yo. I just call Microseconds(), record the times in a
buffer, and then calculate a moving average to report to the UI when
it asks (ten or fifteen times a second looks good). It works well
enough for me, although you might want to record a peak value too.
For the first point - well a concerned user (or even your own UI) can
take the load your AU reports and subtract it from the overall CPU
usage reported by Activity Monitor, to determine how much time other
people's code is wasting:-)
For the second point - the only times I've seen a render thread
blocked are for page faults (obviously) and when the dynamic linker
runs (for example, the first time I load the UI for a module that
happens to use OpenGL).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
Ian Kemmish 18 Durham Close, Biggleswade, Beds
SG18 8HZ
email@hidden Tel: +44 1767 601361 Mob: +44 7952
854387
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden