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

1 Like

Exactly what do you mean?

In the application I am developing, I initially used dynamically constructed variables as if they were local variables, but I saw that they slowed down the process. Now I have many global variables defined, many of them named with the name of the function in which I use it, but I still have very slow access.

Many variables I fill at runtime through the get method of lists (because I have stored the information in lists of lists as if they were arrays)

Currently I spend the day looking at how to cheat the processes so that at least the application does not seem so slow.

Stored variables can slow down an app, especially if you are setting/getting many of their values at once.

Are you using many stored variables?

If so, you might want to consider a local data source instead.

1 Like

None.

There are certain values that if I save / retrieve, but I do it at certain times: when I start the application, if I add new information or if I change the profile (the application can store multiple profiles)

Said saving / recovery I do them by hand with “Local Storage” and as I say, when starting the application or at certain times if it is necessary to save because the information has been modified or recover because the profile has changed.

At first I used dynamically created variables as if they were local variables, but I saw that that if it slowed down the process and I replaced them with global variables app

1 Like