Any feedback on free plan made apps that start slowly every time?

Have you encountered this problem?
Is it slow to access an app made public?

While I cannot say anything for sure without seeing the script, this problem occurs most likely because you have too many server calls running upon form start-up. If this is the case, try moving them to form_show event instead.

This problem can also occur due to too many forms or dependencies.

If you are comfortable with sharing a clone links, please share it. Because I am using a free plan as well (since my website isn’t ready yet) but I do not encounter any such problem.

1 Like

Anvil app optimization isn’t a simple topic.

As @divyeshlakhotia says, server calls can often account for a lot of it. In particular, every server call has a set overhead. Rather than making multiple server calls make a single server call that returns everything the multiple server calls would have returned. That minimizes the set overhead.

Import overhead in server modules can have an effect, too. All your global imports are performed even if a particular server function doesn’t need them. Some imports (especially third-party imports) can take some time. Timing those and moving the time consuming ones into the server functions that need them can help overall performance.

The amount of data returned can obviously have an effect, too, as can inefficient algorithms.

So, lots of things that could be causing slowdowns, none of which are specific to the free plan. The only slowdown that would be specific to the free plan is if you are exhausting the amount of CPU free plans get, which is probably unlikely if you’re just using it for development and individual testing (although background tasks that do too much can use up a lot of CPU).

3 Likes

@divyeshlakhotia @jshaffstall
Come and have a look at it for me
How do I optimize the whole program
https://anvil.works/build#clone:CXMUQP7BHYS5OG7Z=LSARGTZWSVUNN2UJT37XTIGF

Which action when taken in the app do you consider to be too slow? You can’t optimize everything at once, you need to focus on the slowest part first.

You’re also using a couple of dependencies. The clone will not run without them. See this post for how to share an app and its dependencies: Best practice for sharing an app with its dependency - #2 by campopianoa

the dependencies:
https://anvil.works/build#clone:CXMUQP7BHYS5OG7Z=LSARGTZWSVUNN2UJT37XTIGF

I figured out the reason. It is happening because you have too many imports in your Native Library. I tried removing them and the app loaded instantly.

2 Likes