Servoy keeps a cache of related foundsets in memory, once a related foundset is queried from the server it will be reused and not re-queried.
These foundsets are cached using soft references which means that when memory is running low the foundsets are removed from the cache.
Calculations are ‘lazy’ which means that they are only executed when the value is used somewhere after which the value is cached.
When a calculation is executed, we track which data is used in the calculation.
When some of this input data is changed, the calculation is invalidated.
Only when a the calculation is needed again (in scripting or when shown in the UI) it is executed again.
Aggregates are cached with the foundset (for example orders_to_detail.count_order_detail is kept with the orders foundset) and is also executed lazily.
I think that knowing that is good for better developing practices. Sometimes you might do something useful in a big impact in performance and other times you might not use something useful because you think that could be bad for performance.