Reuse parsed expression in SpelValueExpressionResolver#46253
Conversation
Signed-off-by: Dominique Villard <dominique.villard@doctolib.com>
I don't think we can be certain of that as the
I wonder if this may be premature optimisation as we haven't seen any issues with |
|
@wilkinsona, i did some rudimentary performance tests and the gain is marginal (few micro-seconds). |
|
It's certainly not clear that it's worth it. Let's leave things as they are for now. We can reconsider in the future if it becomes apparent that we need to strike a different balance between memory usage and CPU usage. Thanks anyway. |
So far expression is parsed everytime the value is resolved.
My proposal is to reuse the parsed expression.
Since the value resolver is used only for a predefined set of expressions the map should contain only a few items.