iOS Question debug vs release speeds

sorex

Expert
Licensed User
Longtime User
Hello,

Is there a big difference between debug and release speed as we have in B4A?

I have a routine here that takes miliseconds on B4A and when I run it in B4i it takes several minutes.
I first thought my routine bugged but it just takes ages.

I suspect the debugger as cause.

Is there a way to have it run with debugger disabled?
 

tufanv

Expert
Licensed User
Longtime User
I generally do not use the debugger since very few things runs much slower than the actual one. I cant remember an example now but as i said in few cases..
Hello,

Is there a big difference between debug and release speed as we have in B4A?

I have a routine here that takes miliseconds on B4A and when I run it in B4i it takes several minutes.
I first thought my routine bugged but it just takes ages.

I suspect the debugger as cause.

Is there a way to have it run with debugger disabled?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
wicked...

placing a dim of a sub variable outside the subroutine makes this a couple 1000% faster. Now it's instant.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I generally do not use the debugger

I thought you couldn't without using the release version but this can only be tested after publishing it?

Or was that messing around with these dev certificates?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
it seems like it was a lucky shot, it is again dead slow.
With a development certificate and provision file tied to the certificate you can build a release build and b4i bridge will install the release version automaticly to your phone without debugger. (When b4i bridge is foreground on your phone release build will be installed automaticly to your phone)
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
when I clean the project and re-start the compile it's always fast. when I wait a while and recompile it's dead slow again until I re-apply the clean.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
any idea what causes the slowdown?

in my case it went from miliseconds to nearly 10 minutes for a routine to finish.

even on my C64 it would be miliseconds to depack such data.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
any idea what causes the slowdown?
Yes, but it is complicated to explain. The rapid debugger uses two layers. One is fast and static and the other is slower and dynamic. When you change your code the compiler will try to avoid updating the static layout (which requires a full compilation + deployment) and instead only update the slower layer. In most cases the speed will still be reasonable and you enjoy a very quick debugging cycle.

However, depending on the modified code, it may be too slow. By cleaning the project you force the compiler to rebuild the complete app and update the static layer.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
yes, I know the way to avoid it now. it's just more interactions in the IDE and on the device (Install prompt).

Why this routine gets so slow is unknown, it's just a bit based data fetch from a byte array and it seems like it almost needs a second to read one value.
 
Upvote 0
Top