Page is Slower When I Navigate Away & Back: Listeners, Data Resources, or...?

Hi,

I’m trying to build a low-latency multiplayer game, and I’m noticing a substantial decrease in performance when I navigate away from a page and then return to it later. I’ve set up IF logic to close all of my loops per this discussion, so I believe I’ve narrowed down the source of the lag to two Likely Candidates:

A) Event Listeners: I used to have an even listener for an App Variable on this page, but I noticed that when I navigated to a new page, the original page’s listener continued to fire, so I changed it to a Page Variable listener. However, given the “continues to fire even after navigating away” behavior, is it possible that when I return to the page, I now have two copies of the same listener trying to fire at the same time? If so I could see that gumming up the works a bit.

Screen Shot 2020-12-05 at 1.20.13 PM

B) Data References: I notice that when I leave and then return to a page, a new instance of the same-named data reference is created. The loop referencing the original data reference has been broken (which is why in the screenshot below you can see two different pieces of data at index 1 in Objects), and the two data resources have different IDs, but I’m wondering whether there might be a piece of the AppGyver internal logic that doesn’t know the difference between the two IDs or is finding the existence of multiple data resources of the same name more difficult to parse. (For example, a container whose “Repeat With” is a subset of the “Objects” data resource seems to choose the correct instance of “Objects,” but I wonder if it’s slowed down by the fact that there are two resources named “Objects.”)

Do you think either of these might in fact be the cause of the slowdown? And if so, is there something I can do about it? (Like an option I’m unaware of that would allow me to completely delete a data resource when I leave the page?)

Or is it potentially some other issue that I haven’t considered?

Thanks,
~Ethan

P.S. Are App IDs considered private information that should be safeguarded, like a password? Happy to PM my app ID to an admin (or post it here) if that would help.

Are you using 1.9.22 or 2.4.17? These issues were something we knew to exist in 1.9.22 and earlier, which the 2.X runtime should have fixed. If you try using preview-beta and debugger-beta, are you still noticing the same problems?