Performance Issues Working with Anvil Data Tables and Row Iterators

I’ll refer you to my earlier message. You’re observing the laziness of the search iterator. I am guessing the full python runtime is beefier so you are faster but the fact remains that, due to the laziness of the iterator, you are making multiple subsequent calls to get the data.

Search iterators are generator functions that return SOME (not all) of the data with each yield. So if you use list comprehension (or any other method that unpacks the iterator), it is going back and forth to the server until its exhausted. Expensive! If you do this client side, it’ll be even worse (probably MUCH worse), because those subsequent calls will incur the network time as well.

It is worth noting, this only matters when you are dealing with a lot of rows (ballpark >1000 server side, a couple hundred client side).

Look for “Search is Lazy”:

1 Like