Skip to main content
Inspiring
October 6, 2025
Question

Do expressions use caching? (expression performance help)

  • October 6, 2025
  • 2 replies
  • 482 views

Hello.
I have many layer with the same expression on their position property.
This expression repeats the same tasks(repeated code) for all the layers, which make the performance very slow.
My question is can I make a sudo effect (property) calculates the repeated code, and then just get a cached value for this property to the position properties and improve the performance?
I don't know if using propery.value uses some caching system or not.
I am using some heavy algorithems, so this will help me so much achieving what I need.
So I hope you help me acheive this😊🙏.
Thank you!

2 replies

JohnColombo17100380
Community Manager
Community Manager
October 15, 2025

Hi @ahmed hamed elsaid,

Thanks for asking about this. I'm from the After Effects team—could you provide more information about your use case?

 

In general, yes, doing expensive calculations on a separate property that drives other properties can take advantage of a "pseudo" caching, but the caching in AE is more complex than "have I run this expression before?". Anytime that the expression contains calls out to other data or properties, which also may have changed, answering that question generally involves executing the expression again. Simple property links are generally cached, but values changing over time will have the same cache lifetime as rendered frames themselves.

 

Adding further complexity is that any expression which calls to another expression-driven property will require a new JS engine be spun up to evaluate that second expression. This can lead to stack overruns if that second expression calls another expression-driven property, etc. The best rule of thumb is to keep all expression references as O(1), since they are already running in a loop (once per frame) or use tricks like posterizeTime(0) to limit how many times an expression will execute.

 

Hope that is helpful,

- John, After Effects Engineering Team

Inspiring
October 16, 2025

@JohnColombo17100380 

Here is more information about my use case!
I am working on a tool to create grids and add items (layers) inside the grids' cells.
You can see some results in these videos:
video 1 video2

So, how this thing work exactly?
There is an expression on each layer's position and scale property that calculates the right place for the item each frame.
This expression actually the same code for all these layers.
The expression calculates all the positions for all the layer's and then picks the position of the current layers that is on.
The expression is not very fast, and calculating it for each item('layer) makes it even slower, it will be a major optimization if I could calculate this expression on a psudo effect, and we make the layers get the result array and get its position and scale values!
This picture here can impove the understanding of my case:

Inspiring
October 20, 2025
Kevin J. Monahan Jr.
Community Manager
Community Manager
October 7, 2025

Hi Ahmed,

Looks like no one's answered your specific question just yet, but I did ask the product team about it, and I am awaiting an answer for you. In the meantime, you could check out this article on improving performance. https://adobe.ly/48Ri4q6. I hope it helps: 

 

Thanks,
Kevin

 

Kevin Monahan - Sr. Community and Engagement Strategist – Adobe Pro Video and Audio
Inspiring
October 7, 2025

@Kevin-Monahan 

This piece of information would really help me so much as an adobe extension developer.
I will wait for the answer😊🙏.