Delays when using function blocks in loops

Hi Thunkers,

I have noticed in several places of my app that some execution times where not making any sense. I managed to trace the issue down to the use of functions. I have made a very simple app to test my findings.

I have downloaded this directly to my Android to rule out interface delays. Calling functions seem to be taking unreasonable times. I have tried this with several different arbitrary tasks with similar results.

Also the overhead on this simple app is 36Mb. Is that normal?

https://x.thunkable.com/projectPage/5f096a5c05e9080abe26788b

2 Likes

You’re right. More information about performance on http://droidscript.ru/main/statyi/thunkablex_base11.php

The large file size of empty applications is a feature of Thunkable X. The file size for IOS ipa is even larger (times 2)

3 Likes

Thanks for the link @actech . These tests are exactly what I was looking for.

Hey @eddie.rebehy and @actech - we’re working on some (unrelated) updates to the function blocks which are in review at the moment and they will hopefully be out later this week or early next week.

Once that update is out we can start looking a bit closer at what’s going on here and start planning the next update. Just to be up front about this though, this is not something we’re going to be spending a significant amount of time on in the coming weeks.

@eddie.rebehy if you have a loop like this where you need to do something 1,000 times, our advice for the time being is to just place the blocks in-line, rather than creating functions for everything. This will allow you to get the fastest possible version of your app to your users, and in a future update you can then optimised the blocks.

Hope that helps.

thanks @domhnallohanlon.

I understand and will continue to work around this for time sensitive tasks.

1 Like

Recently, a forever block has appeared in blocks. Why is this loop needed if it runs 246 times slower than the slowest for each loop?

изображение

изображение

1 Like