Android Question Rapid Debugger Slows App Performance until clean build?

timoTheos

New Member
When developing/debugging my sample unscramble app (attached) I noticed performance was incredibly slow iterating over 300+k items in a list and figured maybe it was just not the best way to search for scrambled words. But then when I ran the release mode it was lightning quick and more like what I had expected after experience with developing mobile apps with other frameworks. So I switched back to debug, and it again gave immediate results rather than being slow (and I mean 30+ min to search all 300+k words in the list).

Further playing around has revealed that the problem seems to be in the rapid debugger. If I clean the project - it runs fine. Once I make an edit in the btnSearch_Click event handler (or any of the subs called from there) it immediately goes into "go slow" mode until I clean the project again.

I've tried it on both emulators and real devices (connected via USB) with the same results. Is this expected behaviour for the rapid debugger or am I missing something here?

Simplest way to replicate the issue is to adjust the value of LogEveryX on line 69 of main (inside the #if debug of btnSearch_Click), save and click the button and watch the log output to see how long it takes each Log message to be printed.

PS words_alpha.txt has been cut down to 100k lines to fit in the zip file's max size - the original file can be downloaded from https://github.com/dwyl/english-words
 

Attachments

  • Unscramble.zip
    292.7 KB · Views: 209

Erel

B4X founder
Staff member
Licensed User
Longtime User
The debugger includes two execution pipelines. One is slow and flexible and the second one is fast and static. When you modify a sub or put a breakpoint in a sub the slow pipeline will be used for that sub. In most cases it is still fast enough. However for subs with large loops it will be too slow. In that case you should clean the project to force the compiler to make a full compilation.
 
Upvote 0
Top