We regularly have users complaining about long loading times, but usually when I try to recreate their issues it is fine; the following issue are only occasionally a problem. This is also not the only place we experience long loading times, but I really struggle to find an explanation for this one.
The attached screenshots are from an On View Load action. In this instance, a Read Objects node using the ‘Read from other’ setting took 9 seconds(!) to return 0 objects from an empty Many-cardinality data source to a One-cardinality data source. Both runtime.
We recommend checking Generated Data Sources in your DevTools, and checking if other database connected data sources potentially use these runtime data sources in their filtering. While reading from runtime to runtime should in theory be memory only, there can be cases where this read action causes knock-on effects which need to go through the database, which takes longer time. Generated data sources are also database connected in practice, so these can have an effect as well.
When the action is fast sometimes and slow other times, it can be explained by how the database caches data - documents which are recently or often used are cached and therefore returned quicker, but in “unlucky” situations regarding number of objects and indexing it can take a long time as well. This is especially true when sharing infrastructure with other Appfarm solutions.
With this being said, ops have recognised from this post an optimalisation possibility in cases when reading directly from a data source which is empty. In this case, it will never trigger any database updates, so this is a process which can be optimalised from our side. A challenge has been registered on this specifically.
Thank you for you response! This object has never really been used, so we always read 0 objects, and it is not filtering any other sources.
I found one deep reference one place in the ui in a dialog. Can this trigger a read of referenced objects even though no objects are read?
We will remove this functionality, but disable it first if you want to take a look. I think it seems strange that an object with only a handful objects in DB can have such a significant performance impact. This may be due to caching then?