Request: "Offload to Secondary Thread" or "Don't wait" option for Comps

Certain COMPs in my network that are hogging the CPU and causing the framerate to drop. However, these COMPs are not critical to the overall network and I would not care if their calculations skipped frames and their outputs came out of sync with the rest of the network. And placing them into Engine COMPs or another TD instance is cumbersome… sooo…

Wouldn’t it be great if we could have a toggle on COMPs to tell it to:

a) calculate all its children’s CPU operations on a different CPU thread from the one the main network uses

and/or

b) don’t wait for the calculations before rendering the next frame; don’t try to synchronize; just take the COMPs output whenever it’s ready, and if it’s not ready, use the old output until the new one is ready

Sort of a like an Engine COMP Lite™

I just feel that seeing as TD is so sensitive to CPU hogs, it would be so helpful to allow us to delegate some of the less important hogs to secondary threads if nothing important depends on their output.

Alternately, it could be a top level flag:

image

If I can tell it not to cook, maybe I could tell it not to delay the rest of the network.

Thoughts?

This is what the Engine COMP is for (at least one of the cases). Python doesn’t support actual threading, so cooking a network in another thread will still cause lots of CPU contention between threads if they are evaluating Python.

So there’s no way to tell some ops or comps to not delay the rest of the network if they’re not ready on that frame?

Just the Engine COMP.
Within a single process, a node cooks on demand, so for example maybe 5ms into a frame you may start processing the COMP in question. How does the COMP know how much time it has to complete it’s work. There may be 20ms of work that needs to occur after it, or only 2ms. There is no way to know. The Engine COMP allows the COMP to cook as fast as it can, and the main process picks up the results as they become available.

That’s what I mean, since we don’t know how long a COMP needs to complete the work, in theory, we would just use whatever result is ready at the time, without the main process waiting for a new result. Except instead of needing to put it into an Engine COMP, it would be a toggle on the COMP itself to tell it to take its time, and we’ll just pick up its results as they update. I have a lot of COMPs that I wish would just run on their own independently of the rest of the network, and use their results without needing them to sync to the main timeline at all.

For example, say you have a spaceship flying in the background of a scene, and you want it to just move about randomly, slowly, as a set dressing. I don’t care to have it move super smoothly or with any consideration of what the main process is doing. If I want to add a lot of set dressings like this, I would have to make many Engine COMPs. Even adding one Engine COMP is cumbersome because I can’t edit it and see the changes in real time; it’s a black box.

In any case, what I’m hearing is that if I need to have things that don’t interfere with the pacing of the main process, my only options are going to be engine comp and secondary touch instances.

Is there any plans to make Engine COMPs editable in-place? Or in a popup with direct saving?

Yeah, better workflows for the Engine COMP are things we want to do, such easier editing. But what you are looking for is how the Engine COMP is designed to work. Within a process there is less separation of the data, and there is contention for the Python context, which makes this workflow best in another process.

2 Likes