Impact on CPU Form

I have an app with a repeating panel with the template form with a canvas. For each item it crunches some numbers and draws some shapes. The code has thousands of lines. It can render 20-100 rows per second, depending on the complexity of the drawing.

Here I gave you some info, so you can relate. You didn’t provide any info, so it’s difficult to tell what’s wrong.

I have a class Project in the Globals module.
The form first gets a project: project = Project(project_number), then accesses its members. When it assigns the list of items to the repeating panel, the Project class does only one round trip to load everything. for example when the form does self.rep_pan.items = project.crates, the crates member of the class will do one server call and load everything needed to render all the crates for that project. The round trip is completed before the value is assigned to self.rep_pan.items.

At this point the repeating panel iterates through the crates and renders one by one. Each crate object already has all the info required for the rendering and I’m sure there are no other round trips.

I don’t think the write-back has anything to do with slow response times, unless the template form writes back during the rendering, but… why would it do that?

Unfortunately Anvil can sneakily perform round trips without telling you. I would like to know about it, but I can’t.

1 Like