Repeating panel is slow to populate

Hi @stefano.menci,

By doing as you’ve suggested, I’ve determined that actually populating the repeating panel with repeating_panel.items=my_rows is not the issue as that seems to happen very fast.

What is taking the time is simply just returning data from any server function. I want to emphasise that inside the server function itself, retrieving anything from my data tables is extremely fast. It is only when I measure the “round trip” time for the server to return something back to the client that I see the speed issue.

For example, look at the timings here (units are in seconds, not ms):

The server calls are very simple and the data tables are very small. Server_call_1 is just returning 4 or so rows from a linked table as follows:

@anvil.server.callable
def get_themes(question):
  rows=app_tables.questions.get(question=question)['link_to_themes']
  rows = [dict(x) for x in rows]
 
  return rows

The client call looks like this:

start_time=time.time()
rows=anvil.server.call('get_themes', question)
print('server_call_1 takes ' + str(time.time() - start_time) + ' ms')

Each line in the server function runs very quickly and doesn’t come close to the 700ms you see above.

Is it normal to wait over a second for a few simple round trip server calls to be made? I’m sure I’m just doing something wrong but I haven’t figured it out. Any help is much appreciated.