Performance gain when using collapsed transformations on Subcomps with Essential Graphic Properties
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!