DataGrid
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
DataGrid
Hi,
I have a standard DataGrid which is populated from an SQLite database containing approx. 2000 records.
The DataGrid has 6 text columns although 2 of those contain numeric data.
The DataGrid is populated using the GetDataForLine method.
I am using a 2.4gHz Core 2 Duo Macbook Pro using Mountain Lion and I find the scrolling rather pedestrian.
Is there any way to improve it?
Would it be faster if I was to create my own group of text fields and populate those through my own scripts
rather than relying on the DataGrid?
All the best
Terry
I have a standard DataGrid which is populated from an SQLite database containing approx. 2000 records.
The DataGrid has 6 text columns although 2 of those contain numeric data.
The DataGrid is populated using the GetDataForLine method.
I am using a 2.4gHz Core 2 Duo Macbook Pro using Mountain Lion and I find the scrolling rather pedestrian.
Is there any way to improve it?
Would it be faster if I was to create my own group of text fields and populate those through my own scripts
rather than relying on the DataGrid?
All the best
Terry
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: DataGrid
I whipped up a dataGrid with six columns and 2000 lines of data. It seems to scroll normally and quickly, about 20 visible lines per second. How fast is yours? How fast did you need?
Craig Newman
Craig Newman
Re: DataGrid
How can I answer.
It is hard to measure but compared to a Cocoa based NSTableView there is no comparison.
They scroll smoothly. I know it us unfair to compare them but I am trying to get the best scrolling performance possible.
When dragging quickly the scroll button cannot keep up with the cursor and stutters.
There is no "proportional scrolling" (may be the wrong phrase) when using a scroll mouse so no matter how fast you scroll the distance covered remains the same.
When the DataGrid is behind another window but partially visible the Mac way is that if you hover over the partially visible Table you can scroll with a scroll mouse.
I use alternately coloured rows and I think that may affect the the speed?
I presume the data is moved from one field to the next and the colour of that field is also changed?
Is it possible to have a fixed colour for each row that does not change when you scroll? as I believe that may improve the performance.
All the best
Terry
It is hard to measure but compared to a Cocoa based NSTableView there is no comparison.
They scroll smoothly. I know it us unfair to compare them but I am trying to get the best scrolling performance possible.
When dragging quickly the scroll button cannot keep up with the cursor and stutters.
There is no "proportional scrolling" (may be the wrong phrase) when using a scroll mouse so no matter how fast you scroll the distance covered remains the same.
When the DataGrid is behind another window but partially visible the Mac way is that if you hover over the partially visible Table you can scroll with a scroll mouse.
I use alternately coloured rows and I think that may affect the the speed?
I presume the data is moved from one field to the next and the colour of that field is also changed?
Is it possible to have a fixed colour for each row that does not change when you scroll? as I believe that may improve the performance.
All the best
Terry
Re: DataGrid
2000 records are not that much.tellboy wrote: The DataGrid is populated using the GetDataForLine method.
Have you tried to populate your DG with the regular dgText property ?
Re: DataGrid
Yes, I have tried both methods.
If I use the dgText method there is a slight but noticeable delay while the data set is loaded by SQLite and the scrolling smoothness does not really improve and if my database increases in size then this delay will only become worse.
I think I have bumped up against a limitation of using a DataGrid that is created using LiveCode's Scripting methods rather than being a fully fledged control built into the LiveCode Runtime and created using C/C++.
Are there any externals out there created using C/C++ that can overcome the limitations of the scripted DataGrid?
Why can't RunRev create a DataGrid/Table with all the bells and whistles but in C/C++ or is it beyond their programming capability?
All the best
Terry
If I use the dgText method there is a slight but noticeable delay while the data set is loaded by SQLite and the scrolling smoothness does not really improve and if my database increases in size then this delay will only become worse.
I think I have bumped up against a limitation of using a DataGrid that is created using LiveCode's Scripting methods rather than being a fully fledged control built into the LiveCode Runtime and created using C/C++.
Are there any externals out there created using C/C++ that can overcome the limitations of the scripted DataGrid?
Why can't RunRev create a DataGrid/Table with all the bells and whistles but in C/C++ or is it beyond their programming capability?
All the best
Terry
Re: DataGrid
You should perhaps try :
http://lessons.runrev.com/s/lessons/m/d ... ts-of-data
this stack has a sql db with 50 000 records.
and (on a laptop with windows 7), it seems that there isn't any problem of scrolling speed.
http://lessons.runrev.com/s/lessons/m/d ... ts-of-data
this stack has a sql db with 50 000 records.
and (on a laptop with windows 7), it seems that there isn't any problem of scrolling speed.
Re: DataGrid
Hi,
No need for me to do that as I understand how to script the DataGrid.
Thanks anyway.
All the best
Terry
No need for me to do that as I understand how to script the DataGrid.
Thanks anyway.
All the best
Terry
Re: DataGrid
I was talking about the stack itself, not the lesson.tellboy wrote: No need for me to do that as I understand how to script the DataGrid.
Just to check if you have the same speed problem with this stack (that handles much more records than yours).
Re: DataGrid
I apologise, I misunderstood.bangkok wrote:I was talking about the stack itself, not the lesson.tellboy wrote: No need for me to do that as I understand how to script the DataGrid.
Just to check if you have the same speed problem with this stack (that handles much more records than yours).
I have tried this stack and it does perform reasonably but the size of the DataGrid is only 524 x 352 and has only 5 data rows.
My DataGrid 900 x 520 with 20 rows of data and 6 Columns giving 120 cells.
When I increase the sample DataGrid size and increase the number of rows then clearly for each insert of data it has more work to do and so it's performance when scrolling deteriorates.
With the GetDataForLine the actual size of the database does not really matter as you ask the database for the data associated with a line as required by the DataGrid. The time taken to refresh the screen with data when scrolling is related to the moving of the data between the fields of the DataGrid, so the larger the size of the DataGrid (number of cells) the longer it will take to populate with data.
There clearly comes a point where the number of cells to be loaded with data when scrolling is affecting the DataGrids performance. This degradation in performance becomes more pronounced because the DataGrid is implemented using Scripting rather than C/C++ which would be order of magnitude faster.
As I am only using text and the DataGrid is capable of handling so much more I was hoping some of the stuff that the DataGrid is capable of doing could be turned off somehow and perhaps that would aid the speed of scrolling? or...
Perhaps someone knows of an external that is C/C++ based that can provide a table?
Perhaps RunRev would include a proper integrated Table/DataGrid as part of the ongoing update to LiveCode?
All the best
Terry
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: DataGrid
I made another datagrid, 100,000 lines and twenty columns.
This is slower for sure,about 8 lines per second as opposed to 20 per second for the 2000 line by six column DG. Changing any of the cosmetic properties, like alternate row color or line hilite makes no difference in speed.
An intriguing feature would be the "proportional scrolling" you mentioned. This can be done.
Craig
This is slower for sure,about 8 lines per second as opposed to 20 per second for the 2000 line by six column DG. Changing any of the cosmetic properties, like alternate row color or line hilite makes no difference in speed.
An intriguing feature would be the "proportional scrolling" you mentioned. This can be done.
Craig