[TIMOB-1431] TableView extremely slow with SDK 1.4.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-05-02T17:40:23.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | ios, iphone, performance, tableview |
Reporter | Michael Descher |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T02:52:10.000+0000 |
Updated | 2017-05-30T17:21:54.000+0000 |
Description
The following code runs fine on the iPhone 3GS, the iPhone simulator and the iPad simulator when the app is built with SDK 1.3.2. When building the same code with SDK 1.4.0 it renders extremely slow on the iPhone 3GS. You can see the individual rows becoming visible one after the other and when you try to scroll right after the first rows have been painted, you can see that it takes really long for the next rows to show up. I can see the same behaviour in the iPad simulator (another issue is that you have to click somewhere in the simulator to make the table visible at all). Only the iPhone simulator works fine with SDK 1.4.0 as well.
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow();
var rows = [];
for (var i = 0; i < 200; i++) {
rows[i] = Titanium.UI.createTableViewRow({className:'test'});
rows[i].add(Titanium.UI.createLabel({text:'row ' + i}));
}
var table = Titanium.UI.createTableView({data:rows});
win.add(table);
win.open();
I'm seeing similar drop offs in tableView performance with 1.4. Noticeable lags when setting data.
Me and these poeple too: http://developer.appcelerator.com/question/51461/slower-tableview-drawing-with-ti-14"> http://developer.appcelerator.com/question/51461/slower-tableview-d...
I also found this performance issue!!!!
I also have seen this (was this reported previously under another ticket?) Also, rows in the TableView will not be painted as long as the screen is moving, so if you "flick" the screen to move down, nothing appears until the motion stops, then the rows appear, one-by-one. Really annoying and confusing to the user, since they cannot see where they are for some time.
Ran into this recently.
I have a TableView with no more than 10 rows. The rows do store a bit of data (I used JSON.stringify() on some objects to store them in a DB and I parse them to populate each row.
When I open the window that has the TableView it can take between 10-20sec to load. Once rendered performance is OK.
Hope this helps.
jbermudez: I'd make sure that the loading time isn't due primarily to the JSON-related operations you're doing. JSON parsing with Titanium can take a LONG time if you're dealing with a lot of JSON.
Robby:
I will remove the JSON parsing from my table view operations and run them after. I will post test results.
Thanks.
Robby:
Removing the JSON.parse() from the operations in my tableview do speed up the process but I still get a 2 second delay before the TableView gets rendered. I had another project with similar tableview setup and before 1.4 did not have that type of delay.
The 10 lines of simple code in the original post clearly show that there must be a non-json-parsing related problem with table views in 1.4.0 which was not there in 1.3.2. It was reported about 6 weeks ago and nothing has been done. I am sure the people at Appcelerator have many issues to look at and to solve, but table views are an essential feature used in many apps, so I wonder why this bug is not fixed yet. I will most likely start native iPhone programming soon since I cannot rely on a framework with such problems. I am still on 1.3.2 which I patched myself with the latest video player code since the one in 1.3.2 had too many problems for my app.
yes,I agree to Michael Descher, The talbleview's problem is very hard for us, please solve it!!!!
Tested on an iPhone 3GS using TiSDK 2.2.0v20120814103312, there does seem to be a bit of a lag when scrolling.
Resolving ticket as Invalid as we are now on SDK 6.0.4 GA and this ticket hasn't been touched for a number of years.