App latency issues - Returning data from the server to the client / rendering the front end?

Please check out my sample app. its a basic CRUD app. Initially I had just text columns in my table in the data base - latency was sub 1 second. then I added a simple object column and it went up to around 2 or 3 seconds. Once I start linking tables and displaying them to the user the latency has gone to about 8 or 9. There are only a few records, although the server side computation time hasn’t really changed throughout the process. Its either getting the data from the server to the client or the time that the client is taking to render the display to the user that is being effected.

  1. Is there a way to see how long the data is taking to go from the server to the client?
  2. Am i structuring the display components in some fundamentally problematic way?

The actually app i am developing is significantly more complicated, and has a rendering time of nearly 15 seconds!

https://anvil.works/build#clone:PXFU6X3M3XSZ7WHT=MY4VNWBBZA6GNB5THVMAPOYC

There are certain bottlenecks that occur when passing data between server and client in terms of speed.

Much of this has to do with avoiding round-trip server calls, and in general, having an understanding of how returning live rows from the server can affect performance.

Please read these posts and follow the suggestions. I have personally benefited a great deal from these suggestions.

2 Likes

thank you so much, I am still digesting the information you have linked to, but I have already seen a huge speed up in the small changes I have made so far in my app. the casting to dict of each row object has effected how I delete from my table as the row dict doesn’t have a row id element by default, I was passing the row object to the delete function on the server previously. I am thinking i need to add the row id to the row dict on the server side… and the delete the object by getting that row by id and then calling delete on it.

Yes, these are all things that I had to learn along the way too. There is no single approach, but you will learn what works best for your types of applications given the various trade-offs. I generally try to limit the number of server calls and return dictionaries that contain the information I need (I got this advice from @stefano.menci). Again, this is not what I always do. It depends. There are examples on the forum concerning getting row IDs along with your dictionary as well.

Good luck with your further development.