With 10k blocks the browser is slow

Hi everyone. My app is >10k blocks and I'm seeing a sharp slowdown. Working this way is frustrating because I have to wait minutes to see each change in the blocks.
Probably the problem is the high memory used.
Are there any solutions?

When you have too many blocks spread out over too large a surface area,
the Blocks Editor hits a complexity limit when it tries to generate a blocks.png file for the screen.

There are two main approaches to deal with this:

  • Start a Google Doc with a Table of Contents explaining your app, with sections for Design, Data, Code, including Downloaded Png images of all Events, Procedures, Globals, and with html cross-links for easy navigation. Such a doc becomes easier to read than a complete blocks image, because you have FIND, Next, PREV, back functionality, and you can add paragraphs of commentary around your code. This is my preferred life saver when doing a very large complex app. If you go this route, try to arrange your blocks geographically in a column matching the order of your Table of Contents, then do periodic Clean Up Blocks to pull them inline. This sometimes lowers the load on the Blocks Editor.
  • Reduce your block count:
    • Use parametrized procedures for common code
    • Use Media text files instead of big clumps of text blocks
    • Use generic blocks instead of repeating component event blocks
    • Encode repeating decision patterns into lookup tables loaded from Media csv text files (does your blocks image look like a box of combs?)
    • You don't need a component for every data instance. Reuse those components.
    • If you can't fit data into a ListView or List Picker, show a small subset of the data in an Arrangement and slide it across the larger list of data.

..

Thank you for your reply.
Unfortunately both your suggestions mean I will have to make my app for entire...and I have not this time...
Other solutions?

and

You are in CONTROL but you do not have time to learn that 10000 blocks is at the limit of what can be handled unless you make your Project smaller. :disappointed:

You can spend your time waiting for Blocks or learn how to code using the suggestions abg provided.

Why not use a different compiler?

Which browser do you use? I've seen better performance in Firefox than in Chrome for larger workspaces.

I'm currently work in Chrome so I will try in Firefox as you kindly suggest!
Thank you very much @ewpatton

If you haven't been doing so, now is a good time to get block image downloads of your procedure and event blocks for incremental backup

The AI2Helper browser extension is good for bulk download operations.

I would recommend using one of the following three methods:

  1. Minimize your blocks and actively use only the block you are currently working on.
  2. For security reasons, first download your work in .aia format. Then categorize and minimize your blocks. Right-click and download the 15 or 20 block groups with the highest number of blocks, delete these crowded blocks from the blocks screen, and keep them in a folder at hand while you continue working. When you need to generate the app output, drag and drop the downloaded blocks onto the screen while the Blocks screen is open, generate the output, and repeat this step each time you resume working.
  3. You can share some of your blocks. Let’s see whether you are repeating yourself—perhaps there are some new topics you need to learn, or maybe I can learn something new as well.

My app has more than 10k blocks and with Firefox I work well (with Chrome I had problems). Firefox runs more better.

DRY - Don't repeat yourself

Taifun

Thanks a lot to all.
As soon as possible I will try all your precious suggestions!

Hi D_M,
With that many blocks in all, I wonder how many are globalVariables? I've found a useful way of reducing many dozens of globalVariables to just one or two... by creating a Dictionary!!

Basically, the dictionary acts as a single repository of all values that would have been stored in any number of 'globals'. Just 3 blocks max are needed to use a global dictionary in this way :-

  1. Block that initializes and names the global dictionary - starts empty
  2. A setValue procedure to uniquely name each dictionary 'entry' - called a key - that represents a 'global', and provide that entry's value.
  3. A getValue procedure that returns the value stored in the dictionary under the supplied entry name - the unique key.

One serious development advantage with this method is in debugging. During run-time when you rightClick the dictionary's get block and select 'Do It', you'll see all of your 'global' key:value pairs together - just copy and paste the doit result into a text editor to examine all the values.

Hope this helps.
C.

Thank you very much!!!!
I will try this!
:wink: