Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23849] Windows: terrible performance of listview

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-09-05T10:06:41.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0
ComponentsWindows
Labelsn/a
ReporterZakhar Zhuravlev
AssigneeKota Iguchi
Created2016-08-01T09:25:25.000+0000
Updated2016-10-18T17:26:00.000+0000

Description

Creating and adding 50 simple rows to section takes a lot of time. *index.xml:*
<Alloy>
    <Window id="win" backgroundColor='yellow'>
		<ListView id="list" defaultItemTemplate="template">
			<Templates>

                <ItemTemplate name="template">
                    <Label bindId="info" id="title" color="black" />
                </ItemTemplate>

            </Templates>
            
	        <ListSection id='section'>
	        </ListSection>
	    </ListView>
	    <Button width="100dp" height='50dp' backgroundColor="green" onClick='addToList' />
	</Window>
</Alloy>
*index.js:*
var items = [];
for(var i=0; i<50; i++) {
	items.push({info: {text: 'title ' + i}});
}

function addToList() {
	$.section.appendItems(items);
}

$.win.open();

Comments

  1. Kota Iguchi 2016-09-05

    We've been pushing performance optimization overall, and got huge performance improvement especially on ListView: [PR #788](https://github.com/appcelerator/titanium_mobile_windows/pull/788) and [PR779](https://github.com/appcelerator/titanium_mobile_windows/pull/779). This improvement will be available as of 6.0.0 and you can check it out now from Appcelerator [nightly build](http://builds.appcelerator.com/#6_0_X).
  2. Zakhar Zhuravlev 2016-09-05

    Great. Thank you. In some build of 6.0.0 performance was improved in several times. I think, you can close this ticket.
  3. Kota Iguchi 2016-09-05

    Awesome, resolving, marked Fixed in 6.0.0.
  4. Ewan Harris 2016-10-18

    Verified using: OS: Microsoft Windows 10 Pro 10.0.14393 Appc core: 6.0.0-61 Appc NPM: 4.2.8-8 Ti SDK: 6.0.0.v20161017194738 Appc Studio: 4.8.0.201610171310 ListView performance has been improved
       //5.5.1.GA = 7203
       //6.0.0.v20161017194738 = 1047 
       
       function addToList() {
       	var start = +new Date();
       	
       	var fruitDataSet = [];
       	for (var i = 0; i < 60; i++) {
       	    fruitDataSet.push({ properties: { title: 'Apple ' + i } });
       	};
       	$.section.appendItems(fruitDataSet);
       	var msg = 'Elapsed: ' + (+new Date() - start);
       	console.log(msg);
       	alert('Elapsed: ' + (+new Date() - start));
       }
        
       $.win.open();
       
       // 5.5.1.GA = 15375
       // 6.0.0.v20161017194738 = 1734
       var win = Ti.UI.createWindow({ backgroundColor: 'green' });
       var listView = Ti.UI.createListView();
       var sections = [];
       
       win.addEventListener('click', function() {
       	var start = +new Date();
       	var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits' });
       	var fruitDataSet = [];
       	for (var i = 0; i < 60; i++) {
       	    fruitDataSet.push({ properties: { title: 'Apple ' + i } });
       	}
       	fruitSection.setItems(fruitDataSet);
       	sections.push(fruitSection);
       	
       	listView.sections = sections;
       	var msg = 'Elapsed: ' + (+new Date() - start);
       	console.log(msg);
       	alert('Elapsed: ' + (+new Date() - start));
       	win.add(listView);
       });
       
       win.open();
       

JSON Source