Why does a server call from the client take longer than the server code takes to run?

Hi, @shanhewang, and welcome to the Anvil Forum!

It depends on what your code is actually doing. Each program creates its own distinct patterns of activity. Some steps can be slower than others, especially if they’re repeated many times.

And it’s not just database activity that can slow things down. For example, my own server-side code was needlessly importing some very large files. Now, I postpone importing them until absolutely necessary. That reduced server-side startup time on every server call.

You might want to Search this forum for similar topics, and see if they describe patterns found in your own code.

2 Likes