Slow Calculation

Im working on a simple quote/estimate form. The end user will select a product with cost and choose a quantity and discount and it will spit out the final total cost. Everything works great, except the calculations sometimes get confused, like bubble can’t keep up with the inputs or calculations and once it gets confused its pretty much useless. If I go really slow when adjusting the quantity or discount percentage it works fine. Is there a way around this limitation?

Are you using an API to calculate?

Probably better to use local expressions for quick calculations.

Im using the built in bubble calculations (no api). Basically I have input for quantity and I have an input for a percentage discount which created a final amount. All of these calculations do get stored in the database, so im not sure if that the problem or not.

If the searches for those database items take a long time, that might be it.

Seems like it would be a common issue/concern. Any idea on how to get around it?

I think we would have to take a closer look, so please share as many screenshots as you can about this, or link to your bubble editor where everyone can view.

This is a common and thorny problem. In order to keep the calculation accurate, I have dependent workflows that have pauses in between them to be sure that the next calculation doesn’t get ahead of the database. As a failsafe I have it check the summed inputs against the sum in the database to be sure it matches. If not, the user is notified to press a button to do a forced recalculation.

It is not an elegant solution, and it is slow.

There has been a proposed solution to only trigger the next workflow on a database change (rather than a change in the input, which is autobound to the database). That may be a better solution, but I suspect it will still be slow when there are dozens or 100+ calculations with dependencies.

Changing the design (assuming that this is possible in your app) can be a solution if you can break up the calculations into smaller chunks.

So instead of having everything calculate on a single page, you have either multiple pages or multiple view groups on a single page that each handle a portion of it.

Good luck.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.