Quartz Crystal Performance on Multi Core CPUs

stefanhus's picture

Hello!

I wonder how Quartz Crystal deals with multi-core CPUs. As I understand, it is a pure software-renderer (not using the GPU except for things like CoreImage or CoreAnimation maybe), but it looks like, that it never uses more than one-core for a single "Quartz Crystal" instance.

If I render a qtz into a mov (MacBook Pro with 2x 2.53GHz; MacPro with 4x 2.40Ghz), I have noticed, that the quad-core machine doesn't have any advantage in respect to the dual-core machine.

The advantage comes, if I render 4 and more in parallel - maybe somebody can give me some feedback on that. Is there any chance to improve that?

I attached a chart showing "number of parallel renders" against time for both machines and system-benchmarks for both. There you can see, that "single core cpu power" is more or less same for both machines.

Thanks Stefan

PreviewAttachmentSize
qc_benchmarks.pdf31.83 KB
geekbench_macbook-pro.pdf38.51 KB
geekbench_mac-pro.pdf39.42 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
Re: Quartz Crystal Performance on Multi Core CPUs

QuartzComposer is stateful. Thus, a given output frame can depend on all previous output frames. Because of this, it's impossible to render multiple frames simultaneously (rendering frame 2 before frame 1 is finished can generate incorrect results).

QuickTime (used to encode movies) doesn't like multithreaded setups so it takes a significant amount of additional code. It also doesn't provide a significant speed boost (our profiling indicated maybe 10-15% in the vast majority of all cases -- we actually had QuartzCrystal multithreaded in older versions, but it caused more problems than it solved). It also doubles memory usage, because QC's rendering on one (potentially huge) context while QT's encoding from a copy of that potentially huge context (it can't use the destination one because it's getting drawn on).

There's a chance this will be better in Snow Leopard (as QC will probably make use of multiple cores at that point), but QuartzCrystal is too high-level to do that on its own.

stefanhus's picture
Re: Quartz Crystal Performance on Multi Core CPUs

Thanks for your info! So that means it's better to run after "pure horse-power" and/or wait to see, if Snow Leopard will bring some improvements.

Btw. I have seen, that there is an option to specify a start-time for the rendering (which I could use to split a render into 4 jobs for intance) - but that doesn't seem to have any effect for me ... It always starts the rendering with the first frame :-(

Thanks Stefan

cwright's picture
Re: Quartz Crystal Performance on Multi Core CPUs

Can you elaborate a bit on the "starts with the first frame" thing a bit?

All the start time option does is set the Time input to whatever you specified (so your composition has to use timebase stuff for it to be meaningful).

stefanhus's picture
Re: Quartz Crystal Performance on Multi Core CPUs

Well, it always starts from second "0" (0:00) - I can't get the composition to start from 0:10 for instance.

cwright's picture
Re: Quartz Crystal Performance on Multi Core CPUs

Can you send an example composition/sample command line?

stefanhus's picture
Re: Quartz Crystal Performance on Multi Core CPUs

I just tested the rendering ("Quartz Crystal") with a given time-offset by using one of Apple's example compositions and that worked fine.

So I guess, that my composition needs to be changed so that it makes use of the "Patch time" patch - correct?

Btw. I have seen, that "Quartz Crystal" offers "anti-aliasing" and "motion blur" - just for my understanding (not a QC expert yet): is it not possible to do it in QC itself?

Thanks Stefan

cwright's picture
Re: Quartz Crystal Performance on Multi Core CPUs

Regarding Patch Time, yes -- that's how time control typically works in Quartz Composer.

Regarding Antialiasing and Motion Blur -- You can accomplish both of these in Quartz Composer currently, but not without a lot of effort. to achieve AA, you need to place everything in a Render In Image that's larger than the destination, and then scale it down. To achieve Motion Blur, you need to render the objects multiple times per frame, and blend them together (this ranges from very simple, like the QuartzCrystal idle composition, to extraordinarily difficult, depending on how you're blending and what you're drawing).