I have some fairly simple calculations on a page using server connect data. For some reason a few are taking around 10 secs to load showing “Invalid Number” until they do…
It’s basically pulling totals from the same dataset but multiplying by different values based on currency exchange rates, and then adding them together to get the total in US$. The MySQL View which generates the data only takes 2 secs to load so it looks like it’s the actual calculations.
To save some of the client side work maybe consider doing the calculation inside the server action inside a set value step.
Each server action could do its own multiplication first and then you would only need the client side to do the additions and number formatting.
When working with large datasets and you want to calculate for example the sum or average it is best to do that directly with the database query. Formatting data can be done on the client. Small calculations can also be done on the client. We are working on flows for the client-side that will work in web workers, that can be used for heavy calculations without it freezing your site, it doesn’t mean calculations will be faster and when possible you should do calculations on large database sets directly in the query.