I think this is a general problem with many programming languages.
It has nothing to do with FEniCS.
Consider the case where you have an array 'a' and you want to compute
b = cos(a) + sin(a) + a
what will happen here is that an temporal array is constructed
that holds the values of sin(a) + a. This temp array is then later
added to cos(a). If you have a more complicated expression then
many temp arrays may be constructed during the evaluation.
If you don't what this to happen, you need to vectorize
the expression.