App lagg when adding extra logic. Any suggestions?

I recently added additional logic to one of my anycompoent blocks and it has greatly slowed down the functioning of the app. i can only count button presses at a rate of 2/second in the live companion app on my iPhone 11.

here are the blocks. the stuff pointed to with the green pen marks is what was added that slowed down the app. without them, the app won’t work as I need it to. but they slow it down so much. I wonder if anyone has any thoughts on this. Maybe it’s a bug. maybe the anycomponent blocks work too slowly?

please ask questions if you have any and think it will be helpful!

Side note, there’s about 1600 more blocks on this same screen with lots of functions and in place already to alleviate repetition in coding.

Even without downloading the app, I can see that it will run slowly. The answer in the http://droidscript.ru/main/statyi/thunkablex_base11.php

Thanks for the input, @actech! It is always valuable! I understand there is an issue with variable speed. But, when I must use a stored type variable, do you see a better option? Currently, between sessions, I want to save roughly 300 different values, so I use the stored type.

For my app variables, I think many could be replaced with function type variables. However, the admins state this is not a stable fix. What is your opinion on this? Would you mind to show blocks for how you would suggest for this example to replace the app variable “list.timerStartButtons,” for instance, with a function type variable?

@domhnallohanlon, @jane, @Mark - Do any of you have any input on the app/stored variable speed vs. the use of a function type? Any suggestions for improving speed? (Typically I wouldn’t call you out like this, but I’m figuring that this is an architectural issue that most users don’t have a workaround for since @actech is one of the few I see post about this)


We recommend using app/stored variables and not using the ones in functions that are out of scope.

However, @actech is correct that there are some performance issues. I’ve been working on fixing some of these issues , but it’s going to take some time, and I’ll have more specific recommendations when it’s done.

1 Like

@paulmw Thank you for reaching out!

I will patiently await any alerts! I have read that using the ‘function’ type variables may cause bugs. Can you elaborate on this at all?

[update] I am now to 2100 blocks eith no additional slowdown. Hopefully variable speed will improve one day soon! This will really improve the look/feel of many of our apps.

I will be over here in my corner, patiently waiting and slowly drooling in anticipation