I have a anvil app that deals with a 200x15 table. I populate drop downs based on server calls to see unique values in each column. App works great and love the environment. However the startup pinwheel takes forever.
Before I drop $54 to subscribe how much will life improve in terms of speed?
I am considering moving my inventory system over to anvil but bootup speed would need to be tons better
Are you referring to the start-up of the app before it makes any server calls, or is the timing issue related to the server calls in particular?
If it is the later, my guess is that there may be other specifics that are affecting performance. Perhaps we could help if you were able to show code or an example clone.
If it is the former, my guess is that it is not related to paid vs unpaid plans. My understanding is that app start-up time between paid and unpaid accounts shouldn’t differ much (at all?). Anvil staff would know the technical details.
Are you able to clarify what “forever” means in terms of time and/or share an example app? Is this occurring with all apps or just the one? If you are able to provide more specifics as noted above, folks here can jump in and help without having to guess too much about what the issue could be.
There are definitely optimization techniques that you should be able to play with on the free plan. Consolidating server calls, etc. It just depends on how your app works. Posting a clone link (or creating a non-proprietary version that shows the problem if sharing your app is an issue) will let people chime in with ideas.
Here is the source. Been about a decade since I have touched programming outside of scripting so I am assuming there are a bunch of hiccups on my end as well that are exacerbated by Py->JS.
Okay, so with some heavy-handed testing I’ve discovered more than one reason why things are slow.
I have deleted almost everything out of the app to try to zero in on the issue as it was not obvious where all of the bottlenecks were just by placing print statements everywhere (more in a bit).
In general there are many places in your code where datatables could likely be used more efficiently. For example, a proportion of the start-up time is taken inside of the GetDropDowns server function. This is likely due to the 7 or so loops and other operations happening to your DataTables. I have not tried to understand the full picture or isolated the issue to a single line, but presumably there are more efficient ways of getting that information. I would recommend going through the DataTables documentation and the introductory tutorials if you have not already. This may not be an issue at all if you are happy with how things run once the error below is handled.
The second issue, which was much harder to find, was that there was a file called Int.html in the assets section. This was causing an "internal server error". In the app logs it was actually showing as:
": SyntaxError: Unexpected identifier"
There was no indication of where in the code this error was occurring. When I deleted Int.html, that error went away and the app loaded fine (except for the slow server function noted above).
clone of stripped down app with Int.html included (delete it and see that the app loads):