Forum Academy Marketplace Showcase Pricing Features

Optimization - Bubble operating in practice

As a non-developer I would like to know more about good & bad practices so I can :

  • faster the page load
  • make it the lighter I can in the browser of my users for not powerful computers or mobile phones.

Here some thoughts & questions

  1. @Emmanuel told me workflows are very light (for information to whom did not know before like me)

  2. When loading a Repeading Group. Does it load “One item” and then repeat it in the user browser
    or “All the items” are loaded ? I ask because I already made my browser crash loading too many items.

  3. I see the loading of Stripe scripts on other pages than my checkout page. Is it normal ? does it mean each new plugin I add will be loaded on every pages of my app ?

  4. If I write a condition in a conditional formatting, are the checks done in the sense of writing.
    For instance, if the Boolean’s value is false, does it makes a difference writing
    A/ Boolean=yes AND Do a search for Things:blablabla
    or B/ Do a search for Things:blablabla AND Boolean=yes
    In case of A, as first part is false, will it do the query Do a search for ?

  5. One the same page I usually use several (many !) times the same conditions.
    Is it checked only once ? or each expression is verified inde independently ?

  6. The fact that all the element formatting are in the HTML, does it make Bubble generated pages much heavier compared to pages using CSS ?

  7. Adding several Privacy rules, with verifications until a second rank like Type X’Y’Thing=Yes, may it slow the app ?

It’s also about understanding more about this magic dark box framework I use everyday.
Any advice/consideration is very appreciate.

Cheers !

5 Likes

@NicolasDap v nice thoughtful topic!

so I guess you mean short-circuit Boolean evaluation

Bubble evaluates expressions from left to right and with no operator priorities (watch out for 5+3*10, it does 80 in Bubble), like in languages that use a stack and push/pop operations that only push/pop 1 item at a time

this shouldn’t be a problem for doing short-circuit boolean evaluation, since it is also done left to right

@wahome. Thks. Yeah some questions I ve been wondering for some months.

@birbilis. I get the left to right operator priorities but I did not understand anything else. Please don t forget all of us are not developers and that s why we’re here.

Simply put, once a condition is reached where the later conditions doesn’t change the overall outcome, the evaluation should terminate. Take the following for example:

(yes or no) or (no and no)

In the first part (yes or no), since the operation is an “or”, only one of the “statements” has to be true. Since we read it left to right, we first encounter a “yes”, then see the “or”. Since the statement after “or” doesn’t matter, we can stop here and “jump” ahead.

The similar case happens in the second part (no and no).

So when it is actually interpreted it would kind of look like this:
(yes or ___) or (no and ___) where the blanks aren’t really needed.

If this interests you, learn more here https://en.wikipedia.org/wiki/Boolean_algebra

so a question that only Bubble team can answer is, does Bubble use short-circuit Boolean evaluation or not?

@ thks Scott
So about point 4/ it would be better to write B
Do a search for Things:blablabla AND Boolean=yes (NO AND _ => NO)

instead of Boolean=yes AND Do a search for Things:blablabla (YES AND NO => NO)
to avoid the query Do a search for Things:blablabla

So answering a few questions here:

  1. we add the plugin code to all apps in the page, but not the (open-source) jquery plugins. We only add them when the element is in the page. In other words, if you use the FullCalendar plugin, our code goes to each page, the jquery plugin only goes to the page that displaying the calendar. The reason being: the size of the page is one thing, but the time it takes to calculate what to send on the server is not nothing either. There is some room for optimization there, that’s something we reevaluate periodically.

  2. we cache everything we can: search results, conditions, etc.

  3. If you use Styles, the HTML is not much bigger. It’s very similar to CSS actually. if you have different CSS for each element, the page is big, if you use CSS smartly, the page is small. Same with Bubble. No style -> big page, Style -> smaller page.

  4. Privacy rules do make things faster, as they’re check at the server level, so that minimize the number of things we download from the server. So it is better to use them.

2 Likes

Indeed; putting the statements that (1) you know tend to short circuit or (2) require less in terms of computation or accessing data should improve performance. This is just in general. It’s possible that Bubble might prioritize searches last, thus the order wouldn’t matter. Regardless, try to follow what I mentioned as you might not know what’s going on in the background.

Thks @Emmanuel. Appreciate to know a bit more about these stuffs.

1 Like