My app runs substantially slower on the published environment (accessed through the website url) compared with the debug environment (launched from the IDE). Same commit, same code.
Opening different pages takes a few seconds on the published version of the app whereas it is nearly instant on the Debug environment launched from the IDE.
Interestingly enough, the app is also slow when the debug environment is launched in a new tab. So, to summarize:
Debug (run in split view): FAST
Debug (run maximised): FAST
Debug (run in new tab): SLOW
Published app: SLOW
The difference is dramatic (several times slower), even when loading pages cached through anvil extra’s hash routing or running functions that are entirely on the client side and do not make a server call.
What could this be due to, considering that it’s the same code? Are there other users experiencing the same thing? I would love to be able to achieve the debug speed on my production app. Thanks for any ideas or suggestions!
Hi @stucork, the weirdest thing happened today. All of a sudden my published app has the same lightning performance as debug mode. It’s never been this fast… Did the Anvil team change anything today?
Prior to today the app was seriously lagging regardless of the browser (chrome, firefox, edge) and regardless of private/incognito mode (the only extension I have is my password manager). I believe performance was slightly faster on Firefox (e.g., it took 2 secs to open certain forms as opposed to 3 secs). Also the app was faster on mobile browsers.
But today everything is instant…
I can share with you a clone privately if I encounter the issue again, but at the moment I cannot reproduce it.
More specifically, any app instances that were launched when the Ad Blocker was active are slowed down, even if the Ad blocker is subsequently disabled. This is also true vice versa - any app instances that were launched when Ad blocker was disabled remain fast even if it is subsequently enabled.
For the instances that are slowed down, I notice a large effect on my CPU usage in the task manager. Switching forms via anvil extra’s hash-based navigation causes my CPU usage to increase from 7-10% to 30+% (the usage increase is from the browser, not NordVPN), whereas the same action performed on the non-slowed down instances has no noticeable effect on the CPU usage.
Another interesting point is that Debug instances launched in split/maximised view seem to be immune to the slowdown from NordVPN’s Ad blocker. Maybe because the app is running in an iFrame?
Now I wonder why NordVNP’s ad blocker slows down my app so much, whereas it doesn’t seem to have the same effect on other websites I use. I do not run any ads on my app, but I do load many images from an external CDN - perhaps there is some interaction there.