DataGrid Form Slow on Device
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 47
- Joined: Thu Apr 27, 2006 11:19 pm
DataGrid Form Slow on Device
I'm quite surprised at how slow the performance of the DataGrid Form on iOS. Maybe I'm doing something wrong.
1) I pull data from a SQlite database
2) That data is then put into an invisible DataGrid table
3) the dgData of that invisible Datagrid Table becomes an Array
4) I use that Array to populate the Datagrid Form. This is data with 200+ keys.
On desktop it takes <1 second. On mobile it takes 12 seconds.
Any ideas on how to make this faster?
-Todd
1) I pull data from a SQlite database
2) That data is then put into an invisible DataGrid table
3) the dgData of that invisible Datagrid Table becomes an Array
4) I use that Array to populate the Datagrid Form. This is data with 200+ keys.
On desktop it takes <1 second. On mobile it takes 12 seconds.
Any ideas on how to make this faster?
-Todd
Re: DataGrid Form Slow on Device
Hi Todd,
I would try to get rid of the "convert-to-array-datagrid-crutches"
Means, leave step 2 and 3 and convert the TAB delimtied data from the DB to an array
by yourself and see if this will speed up things. I bet it does
Best
Klaus
I would try to get rid of the "convert-to-array-datagrid-crutches"

Means, leave step 2 and 3 and convert the TAB delimtied data from the DB to an array
by yourself and see if this will speed up things. I bet it does

Best
Klaus
Re: DataGrid Form Slow on Device
This turns a list with 6 fields from a database into an array:
function turnListIntoArray theData
put "dbField1" & tab & "dbField2" & tab & "dbField3" & tab & "dbField4" & tab & "dbField5" & tab & "dbField6" into tHeaders
set the itemDelimiter to tab
repeat with x = 1 to the number of lines in theData
repeat with y = 1 to the number of items in tHeaders
put item y of line x of theData into a[x][item y of tHeaders]
end repeat
end repeat
set the itemDelimiter to ","
return a
end turnListIntoArray
function turnListIntoArray theData
put "dbField1" & tab & "dbField2" & tab & "dbField3" & tab & "dbField4" & tab & "dbField5" & tab & "dbField6" into tHeaders
set the itemDelimiter to tab
repeat with x = 1 to the number of lines in theData
repeat with y = 1 to the number of items in tHeaders
put item y of line x of theData into a[x][item y of tHeaders]
end repeat
end repeat
set the itemDelimiter to ","
return a
end turnListIntoArray
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
-
- VIP Livecode Opensource Backer
- Posts: 47
- Joined: Thu Apr 27, 2006 11:19 pm
Re: DataGrid Form Slow on Device
Thanks to you both for your insights. I've tried converting straight to an Array bypassing the invisible Datagrid. It works great in Simulator, but bogs way down to 12-13 seconds. The bottleneck is when I'm setting the dgData of the datagrid form.
Re: DataGrid Form Slow on Device
Hi Todd
Are you doing anything to format the data or anything else special when the form DG is loaded? i.e. in your Row Behaviour? DGs on the device should be quicker than this. Can you post some of your code?
Are you doing anything to format the data or anything else special when the form DG is loaded? i.e. in your Row Behaviour? DGs on the device should be quicker than this. Can you post some of your code?
Re: DataGrid Form Slow on Device
Hi Todd
Did you get any solution to this? Despite my previous post I'm now seeing something similar and am also considering how to optimise it!
Look forward to hearing anyone's ideas. In my case I just have 3 fields and 1 image in each datagrid row and about 55 rows... but intending to have more rows in the (near) future. Slows down to be unacceptable on the device...
cheers
Alan
Did you get any solution to this? Despite my previous post I'm now seeing something similar and am also considering how to optimise it!
Look forward to hearing anyone's ideas. In my case I just have 3 fields and 1 image in each datagrid row and about 55 rows... but intending to have more rows in the (near) future. Slows down to be unacceptable on the device...
cheers
Alan
Re: DataGrid Form Slow on Device
First thing to do is to set the "Fixed Row Height" to true for the datagrid (in the DG properties pane).
Or if that's not possible then try this link for more info:
http://lessons.runrev.com/s/lessons/m/d ... t-is-false
If anyone has more hints it'd be great to get more wisdom here!
cheers
Alan
Or if that's not possible then try this link for more info:
http://lessons.runrev.com/s/lessons/m/d ... t-is-false
If anyone has more hints it'd be great to get more wisdom here!
cheers
Alan
Re: DataGrid Form Slow on Device
After 2 years the datagrid still is still far from useful on mobile (as is almost any other buildin gui control)... The way it scrolls (1 row at a time) inherently makes smooth scrolling impossible apart from the other problems.
For small datagrids you can get around it by placing it in a scrolling group. With large datasets this is impossible since you effectively disable the logic of only rendering whats seen on screen in the datagrid code.
I converted a small desktop program to my ipad but am not satisfied with the way it looks and feels. Sluggish scrolling, especially the datagrid.
For small datagrids you can get around it by placing it in a scrolling group. With large datasets this is impossible since you effectively disable the logic of only rendering whats seen on screen in the datagrid code.
I converted a small desktop program to my ipad but am not satisfied with the way it looks and feels. Sluggish scrolling, especially the datagrid.
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
Re: DataGrid Form Slow on Device
How are you populating the DG? How are you setting up the scroller?
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14