Skip to main content
Inspiring
September 29, 2022
Answered

Performance gain when using collapsed transformations on Subcomps with Essential Graphic Properties

  • September 29, 2022
  • 2 replies
  • 413 views

Hey guys,

 

I'm currently building a modular outro for videos. I use a Subcomp with EssentialGraphic properties to get headlines with a boxed background, that resizes to the text automatically. This subcomp is as optimized as much I can do (posterizeTime(0).

Here is how it looks inclusing the properties taht are available in the headline subcomps: (It's black and white since it'll be used as a mask.)

I noticed that After Effects has an easier time rendering the comp if I enable collapsed transformations on these subcomps. In this comp it only has an animation at the beginning and the rest is static. Motionblur is enabled, although I noticed no difference when disabling it.

I was curious and tested with reset and existing cache how fast the comp can render:
(WIN10, AMD 5950X, RTX3080 12G, 128GB RAM with multiframe render enabled)

5s length:
Render time with collapsed transformation:
No Cache:
	18s
	18s
	16s
With Cache:
	6s
	6s
	
Render time normal subcomp:
No Cache:
	17s
	16s
	16s
With Cache:
	10s
	9s
	9s

10s length:
Render time with collapsed transformation:
No Cache:
	19s
	18s
With Cache:
	9s
	9s
	
Render time normal subcomp:
No Cache:
	23s
	22s
With Cache:
	16s
	16s
	

So I noticed, I get a considerably faster render time with collapsed transformations if the animations are cached and slightly slower or on par performance rendering without a cache on 5s. Due to the optimizations I made, I guess that the collapsed variant will gain more and more on the the variant without, the longer the comp stays static.
The part with animations (first 1s) rendered slower with collapsed transformations, which is what I would have expected.
Here are two imagines of the layers and the layer render times with and without collapsed transformations:

 

Has anybody experienced similar things? This goes contrary to my prior believe that collapsing transforms is always slower. Is this because using EG properties make the render inherently so much slower than on the original comp? It seems like if I don't collapse the transformations the posterizeTime(0) is ignored and is thus costing some render time.


Also how reliable are the frame by frame time values for each layer, animation and expression? Sometimes they show insane values for certain expressions that only do one math calc with 2 references to other layers. Would it be better to reference the calculation instead of having the calculation in the layer itself to gain on performance?

 

I appreciate your feedback!

This topic has been closed for replies.
Correct answer Mylenium

Using CR/CT simply does not generate the intermediate buffers to "flatten" the pre-comps. All layers are treated as if in the parent comp and in a relatively simple scenario this can be noticeable because a render step can be skipped. Would be different if there were effects. The time posterization suppressing expression evaluation certainly plays a part, too. Unless you completely rebuild it to use direct inputs from more sliders instead of layer dependencies I don't see much potential to optimize this further. It's basically a situation where you can't have both.

 

Mylenium 

2 replies

Mylenium
Legend
September 30, 2022

Expressions always evaluate per time-sample and there is no way around this. A frame rendered with 32 times temporal oversampling e.g. for motion blur or frame belnding will trigger 32 evaluations. It's just that some expressions don't do much and the property streams don't register as having changed, so AE can skip over them. CR/ CT is simply short for continuously rasterize/ collapse transformations.

 

Mylenium

Inspiring
September 30, 2022

Ah yes, that makes sense. This is what I experienced as well. 
I also noticed that it doesn't matter how you chain your expressions (e.g. storing calcs in sliders oder points), they always seem to be evaluated at the sample rate.

Mylenium
MyleniumCorrect answer
Legend
September 29, 2022

Using CR/CT simply does not generate the intermediate buffers to "flatten" the pre-comps. All layers are treated as if in the parent comp and in a relatively simple scenario this can be noticeable because a render step can be skipped. Would be different if there were effects. The time posterization suppressing expression evaluation certainly plays a part, too. Unless you completely rebuild it to use direct inputs from more sliders instead of layer dependencies I don't see much potential to optimize this further. It's basically a situation where you can't have both.

 

Mylenium 

Inspiring
September 29, 2022

Hey thanks for you quick response. 
Could you elabroate further on what you mean with CR/CT? I can't decipher these abbrivations.

Yeah, I'm aware that I'm trading render time with convinience here. The posterization itself improved the render times a lot, at least for previews, but that's only anectdotaly. It'd be great to define some static expressions that are guaranteed to only run once per render. But I doubt that will ever happen. 🙂