# Slow blocks editor

**URL:** <https://community.thunkable.com/t/slow-blocks-editor/1015365>\
**Category:** Questions about Thunkable X\
**Created:** [December 2, 2020, 5:59pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365 "2020-12-02T17:59:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbthatsme](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@paulbthatsme](https://community.thunkable.com/u/paulbthatsme)\
**Post date:** [December 2, 2020, 5:59pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/1 "2020-12-02T17:59:55Z")

</div>

The more blocks you have , the slower the editor is - with bigger lag times.

I currently have 1131 blocks and the lag times from clicking to a response is about 5 seconds, and it is getting worse.

I had the same issue with “app inventor” a few years ago and eventually gave up with it, so I was hoping this problem would have been ironed out by now but it appears not.

As soon as you have more than a few hundred blocks the editor starts to get very frustrating and pretty much unusable.

Do other people have the same issue ?  
If so Is there an effective work around ?

Is anything planned to reduce the lag times ?  
Is the problem caused by the auto save feature ?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 2, 2020, 6:10pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/2 "2020-12-02T18:10:38Z")

</div>

When I started using Thunkable last year, I had the same problem with lag. And it got severe right around where you’re noticing it, 1000 blocks or so. But I haven’t any real slow downs in the past few months.

What browser and OS are you using?

---

<div class="post-metadata">

**Author:** ![paulbthatsme](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@paulbthatsme](https://community.thunkable.com/u/paulbthatsme)\
**Post date:** [December 2, 2020, 6:17pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/3 "2020-12-02T18:17:09Z")

</div>

Chrome - Windows 10  
Same using Edge

@tatiang - So are you saying the problem doesn’t get any worse than it is at around 1000 blocks, or do you have no lag at all any more ?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 2, 2020, 8:12pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/4 "2020-12-02T20:12:32Z")

</div>

I’m saying I don’t notice any lag. I’m using Chrome on a Mac, OS X 15 and 16.

Here’s a screencast of a project with 2045 blocks (no sound). I think the Screencastify software interfered with the mouse clicks a bit so you’ll see me struggling to grab one of the blocks but that’s mostly on me.

The screencasting is also undoubtedly adding lag to the video but you’ll see that I can drag blocks around and **at most** it takes half a second to move to a new location.

> **[Thunkable.webm (video)](https://drive.google.com/file/d/19ejli3RCgjXkTDFe0scDt2mc2moeG7Gg/view)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [December 2, 2020, 11:24pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/5 "2020-12-02T23:24:52Z")

</div>

Hey @paulbthatsme,

There’s has been a lot of work done on blocks editor performance in the past, but hopefully we can help you improve this situation.

> [@paulbthatsme](#):
>
> Is there an effective work around

As a first step, I’d recommend optimising your blocks as much as possible, i.e using functions

There should be some examples in #Tutorials and DIY Guides about this.

---

<div class="post-metadata">

**Author:** ![paulbthatsme](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@paulbthatsme](https://community.thunkable.com/u/paulbthatsme)\
**Post date:** [December 3, 2020, 8:52am UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/6 "2020-12-03T08:52:45Z")

</div>

Hi @domhnallohanlon - When you say use functions, is this to try and reduce the overall number of blocks, or does putting blocks within functions help with the lag - even if the total number of blocks is not reduced ?

Just trying to understand if the lag is purely caused by the number of blocks or if the type of blocks also affects things.

---

<div class="post-metadata">

**Author:** ![paulbthatsme](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@paulbthatsme](https://community.thunkable.com/u/paulbthatsme)\
**Post date:** [December 3, 2020, 12:33pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/7 "2020-12-03T12:33:31Z")

</div>

Regarding functions…

I have a situation where I have 4 fire button sprites that relate to different tank sprites.

For example - Fire button 1 relates to tank 1  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/2/f2a4aa279fb37cffb82ba87d790eb88d45a79a77.png)  
So I have to repeat the above set of blocks for each fire button.

I have managed to change this to the following…

So I now check when a sprite type is clicked and get an unused property - drawing width - to determine which fire button is clicked and then call a function.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/3/c32095eced74a5299bbc827f6905c3e1f73a7b02.png)  
But the function still has to have several if blocks relating to the firebutton clicked…

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/7/079747109dc05ad7c4f425284bcc711602efc2de.png)

Is there a better way to do this so I don’t need all the if blocks ?  
Its a shame you cannot have an array of sprites, that would make it much easier.

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [December 3, 2020, 12:55pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/8 "2020-12-03T12:55:09Z")

</div>

I actually can’t see that last screenshot (it’s quite blurry for me?)

But from the shapes/patterns I’d say so.

Possible to upload again?

---

<div class="post-metadata">

**Author:** ![paulbthatsme](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@paulbthatsme](https://community.thunkable.com/u/paulbthatsme)\
**Post date:** [December 3, 2020, 1:46pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/9 "2020-12-03T13:46:57Z")

</div>

So I am checking the fireid and using that in if blocks

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/1/e1a04e9eb63815635cf691136ff805b7a6420c5b.png)

It seems a bit of a clunky way to do it but I cannot see any other way. An array of sprites or an array of any sort of component would be very useful and would cut down the amount of blocks needed greatly, as I am having to replicate a lot of blocks with just the component names different in each case.

Or if there was a way to get a components id. So for example I could have a block “When Fire1 clicked” which could then get the id of Tank1 and Bullet1 and pass those through to a function.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:20pm UTC](https://community.thunkable.com/t/slow-blocks-editor/1015365/10 "2024-11-08T12:20:01Z")

</div>


