Bizarre Performance Variations - Factor of 100...!

Hey Team Bubble and Fellow Bubblers…

I’m half way through a 12 month development project, and have decided to spend some time to really understand performance. So after reading the Performance Q&A, I set about some tests of my own.

I created 10 things of type Invoice and then set about deleting them using a “Delete a List of” action. After some experimentation, I took two different approaches.

(1) A single “Delete a List of” action containing a search for the 10 invoices.

(2) One action assigning the 10 invoice search to a state “These Invoices”, and a second action doing the “Delete a List of”, making reference to These Invoices.

Approach (1) took on average 30 seconds.
Approach (2) took on average 0.3 seconds.

Can anyone help me understand why this is, and if you’ve seen other similar approaches which effect performance in such a way?


I have also noticed this. It seems that if you open a connection to the database first and then perform the action it is always faster. It may have something to do with the way bubble uses Amazon ElastiCache. It grabs the data not just of the initial query but possible X number of invoices. Then every subsequent action is faster. Of course I am speculating but it’s probably in the ballpark.

How are you measuring the time it took, i.e. how do you know the operation has completed?

I’ll take a guess as well.

Approach 1 has the delete operation happen on the server, and the client waits for the server to refresh the client’s database cache.

Approach 2 the optimizer sees a dependency on the custom state, so has the delete happen on the client’s database cache as well, and when the server refreshes the database cache it doesn’t need to make a change.

Ideally @josh or one of the Bubble team can comment on this. @antony can you link this to the performance thread?