How to speedup table population?

IoSonoPiero

Active Member
Licensed User
Longtime User
[Solved] How to speedup table population?

Hello,
I've tried on real device and on the emulator to populate a table with two columns.

To fill 477 rows, it takes 7 seconds.

I use: table.AddRow (value1, value2)

There is a way to speedup the process or this is the normal speed of populating function?

There is some trick (i.e. hide the table before the population process) to give me more speed?

Thanks to this great forum!
 
Last edited:

IoSonoPiero

Active Member
Licensed User
Longtime User
Hello Erel,
the data are loaded from a file into an array.

Then the table is populated getting data from the bidimensional array.
The data can't be loaded with LoadCSV function.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
I recommend you to do the following test:
- Load the data.
- Save the table with Table.SaveCSV.
- Now run your program and load the CSV file. See how much faster (if at all) it will run.

If it does run significantly faster than you can consider converting your file to a CSV file (maybe to a temporary file on the run) and then load it with LoadCSV.
 

IoSonoPiero

Active Member
Licensed User
Longtime User
Mmmhhh, the table is sorted for the first column.

I' ve noticed that the Table.SaveCSV save the content, but this isn't ordered.

There is a way to save an ordered file?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is a way to save an ordered file?
Not a very good one. But you can always sort it after loading the data.

You can go over all the visible rows and add them to another table. Then save the second table. You can also create the CSV file yourself. It is pretty simple if your data doesn't include quotes and commas.
 
Top