[Experimental Feature] Page load performance enhancement and memory reduction

Hi all,

We just released another feature flag on the experimental settings panel. This one is a performance enhancement for run-mode!

As you may know, we had released an optimization to prevent drawing invisible elements on page load until they are shown for the first time. In bubble version 21, we expanded this to not create any DOM nodes at all (which is why it was a breaking change). However, we were still doing a lot of work to construct the internal “state” for elements, which is important for workflows or references to hidden elements that still need to work.

This optimization delays the construction of that state until either (a) we have to draw the element, or (b) we request state from that element in a workflow or an expression. This means for the vast majority of hidden elements on a SPA, we create vastly fewer objects on page load. This not only increases the speed of initial page load (on some not-so-complicated pages I was testing, it went from 1 second of scripting to 400ms), but also means that once the page is loaded the total memory usage should be reduced (one app went down from 300+ MB to 100 MB!).

We are releasing this first as an experimental feature here first as there are lots of potential edge cases with our evaluation logic. We have the intention of eventually rolling it out to all apps on new responsive and BV 21+. Please try it out and let us know of any feedback or issues!


Incredible @cal ! Love to see Bubble improving their speed for run-mode and not just internally (although I have personally really loved the internal speed improvements too)

1 Like

As always, a reminder to all using experimental features: File those bug reports if you think this experimental feature is causing them.


Maybe a noob question, but if you enable it in your dev version, it doesn’t directly become active in your live version, right? You have to push live first?

Yep, that’s right.

I would like to properly evaluate this experiment. How can I go about that?

What’s your methodology? Teach us so we can give you decent feedback.
I’m guessing you’re getting these numbers are coming from the browser’s developer tabs somewhere?

1 Like

Exciting to hear - and VERY glad Bubble is pushing this as experimental first! Look forward to seeing it progress.

1 Like

That’s correct yeah I’m using chrome’s developer tools. There’s a performance tab that allows you to measure a page load (the little refresh icon) and will tell you in a pie chart how much time was scripting / idle / rendering / etc. This fix will improve the scripting time. The other tab is the memory tab, which tells you how much memory a tab is using - I just read those numbers on fresh page loads with flag on vs. off.


Excited for these improvements. I tested for a bit and saw no unexpected behavior.

Would you say this will have a greater effect on single page apps? What types of app will see the largest improvement?

1 Like

As I assume it means that when hidden elements gets data from external API with this mode enabled it wont be triggered until element is visible?

@cal does this have any relation to the hard limit of 10.000 elements, actions, or events on one page?

1 Like