Hello,
I just made a simple multiple choice question app for a customer. It is running very well on Windows and in the IDE.
Now I deployed the stack to a somewhat older Android tablet - and it takes the app about 20 seconds before the start page appears. After that everything is working fine and smooth.
Experimenting I found out that the delay is caused by a script that sorts 270 lines of questions and puts them in an array of categories. This script takes exactly 13 milliseconds in Windows. On Android I measured that this script takes 20 seconds - that means almost 10.000 times as long. How can this be possible? When I leave out the script, the Android version starts after 1 second.
Has anyone experienced similar problems with Android - and maybe found a solution or a workaround?
Happy for any hint.
Kroka
Android standalone extremely slow on simple operations
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Android standalone extremely slow on simple operations
"irgendwas is immer"
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Android standalone extremely slow on simple operations
It won't be possible to fully answer the question without seeing the code, ideally with representative sample data.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Android standalone extremely slow on simple operations
Yes, you are right. I went on experimenting and found the code snippet that was taking almost 20 seconds:
The 270 lines of myList contain each a text of about 200 characters and a number between 1 and 10 after that, seperated by a semicolon.
This operation took 20 seconds on Android. I replaced it by presorting them and saving the lines for each category in a field (instead of using an array variable).
Now the delay is gone. It's less than 1 second now.
I'm happy about that - but the question remains: Why does it take such an amount of time on Android to put 270 lines of text into an array?
Code: Select all
set the itemDelimiter to ";"
repeat with z = 1 to 270
put line z of myList into kat[item 2 of line z of myList]
end repeat
This operation took 20 seconds on Android. I replaced it by presorting them and saving the lines for each category in a field (instead of using an array variable).
Now the delay is gone. It's less than 1 second now.
I'm happy about that - but the question remains: Why does it take such an amount of time on Android to put 270 lines of text into an array?
"irgendwas is immer"
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Android standalone extremely slow on simple operations
I could test that, but to do so I'd need to write a routine to create representative sample data. And since I'm working for free here (happily enough, but free just the same), it would be more encouraging to have sample data provided as a zipped attachment.kroka wrote:I'm happy about that - but the question remains: Why does it take such an amount of time on Android to put 270 lines of text into an array?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Android standalone extremely slow on simple operations
Meanwhile, though (assuming there are only 270 lines of text in myList) try this:
Code: Select all
set the itemDelimiter to ";"
repeat for each line tLine in myList
put tLine into kat[item 2 of tLine]
end repeat
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev