Very slow database performance

As more background, when you call a server function, all server modules get loaded, which imports all modules those server modules import. Even if those modules are not used for that particular server function.

You can time how long each import takes. In your case, the non-Anvil ones came up as:

Pandas 0:00:00.000009
Anvil PDF 0:00:00.000006
io 0:00:00.000004
plotly.graph 0:00:00.208733

So none of them are taking a long time, although plotly.graph is quite a bit longer than the others.

You can move time consuming imports into the server functions that need them, so they only get imported when that server function is called, rather than every time.

1 Like