Wow, thanks a lot for all the responses. Truly thankful for all the support.
I have now tried to time the functions as suggested.
print('client function in) '+str(datetime.datetime.now()))
__joblist = anvil.server.call('get_joblist')
print('client function out) '+str(datetime.datetime.now()))
print('Server function in) '+str(datetime.datetime.now()))
jobs = app_tables.jobhistorymaster.search(tables.order_by("jobDate",ascending=False))
print('Server function out) '+str(datetime.datetime.now()))
First load at login gave these results:
client function in) 2020-09-18 21:26:49.582415
Server function in) 2020-09-18 17:26:51.356574
Server function out) 2020-09-18 17:26:51.620033
client function out) 2020-09-18 21:26:52.038360
Total: 2.5 seconds.
I then added a row, which refreshes the table.
client function in) 2020-09-18 21:27:24.983995
Server function in) 2020-09-18 17:27:26.671233
Server function out) 2020-09-18 17:27:26.776778
client function out) 2020-09-18 21:27:27.177015
Total: 2.2 seconds
client function in) 2020-09-18 21:27:33.282830
Server function in) 2020-09-18 17:27:34.937255
Server function out) 2020-09-18 17:27:35.038419
client function out) 2020-09-18 21:27:35.295425
Total: 2 seconds.
So, from @jshaffstall reply I understand that this is all server lag as I am loading unnecessary modules. And it seems to load them everytime the function is called and not just the first time?
So, I went ahead and removed four modules io,pdf,plotly and pandas. Below result…
client function in) 2020-09-18 21:36:36.501675
Server function in) 2020-09-18 17:36:37.967317
Server function out) 2020-09-18 17:36:38.101370
client function out) 2020-09-18 21:36:38.332245
Total time: 1.8 seconds.
Add a new row…
client function in) 2020-09-18 21:38:14.431935
Server function in) 2020-09-18 17:38:15.985631
Server function out) 2020-09-18 17:38:16.124561
client function out) 2020-09-18 21:38:16.343080
Total time: 1.9 seconds
The performance has not really improved. So, I guess the culprit is somewhere else?
The above two quotes are about things I can try, but I am afraid I don’t really understand what it means to use JSON columns!!
I really did expect that just using the built in data grid and table search function was the easiest and fastest.
Can you help me please with some simpler directions to improve the performance?