Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): improve pre-loading optimization of ListView and TableView #12781

Merged
merged 6 commits into from Jun 7, 2021

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented May 6, 2021

  • Improve initial pre-load performance of both ListView and TableView
  • Queues pre-loading of rows on UI thread, preventing initial stutter
  • Pre-loads until user interaction for smooth initial scrolling
  • Increased recycler cache size
  • Prevent concurrency exception when attempting to load multiple images
    • NOTE: This would cause some image views to never load and stay blank
TEST CASE 1
const win = Ti.UI.createWindow({ backgroundColor: 'white' });

function createSection(rows, suffix) {
	const section = Ti.UI.createListSection({
		headerTitle: suffix ? `Section ${suffix}` : null
	});
	const items = [];

	for (let i = 1; i <= rows; i++) {
		items.push({
			properties: {
				title: `Row #${i}`,
				image: 'https://picsum.photos/100'
			}
		});
	}
	section.items = items;

	return section;
}

const listView = Ti.UI.createListView({
	sections: [ createSection(256) ]
});

win.add(listView);
win.open();
TEST CASE 2
  • Check JIRA

JIRA Ticket

@garymathews garymathews added android bug no tests backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge labels May 6, 2021
@garymathews garymathews added this to the 10.1.0 milestone May 6, 2021
@build build requested a review from a team May 6, 2021 22:08
@build
Copy link
Contributor

build commented May 6, 2021

Fails
🚫 Tests have failed, see below for more information.
Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 3 tests have failed There are 3 tests failing and 740 skipped out of 12583 total tests.

Tests:

ClassnameNameTimeError
android.emulator.Titanium.UI.ScrollViewcontentOffset (5.0.2)0.25
Error: Uncaught Uncaught AssertionError
ios.macos.Titanium.Network.HTTPClient#timeoutForResource (10.15.5)0.002
Error: onload shouldn't fire. Resource request timeout should reach before transferring entire resource.
file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-12781/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/ti.network.httpclient.test.js:810:40
ios.macos.Titanium.Network.HTTPClientresponseHeaders (10.15.5)60.094
Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)

Generated by 🚫 dangerJS against 2d586a9

@garymathews
Copy link
Contributor Author

@m1ga I believe you ran into an issue where images would sometimes not load? Let me know if this solves that issue for you

@m1ga
Copy link
Contributor

m1ga commented May 7, 2021

@garymathews I'll try this PR, sounds great! For me the issue with the "not loading images" was already fixed in the master builds after March 12th but I've linked it in the other issue I had because there was someone else where the master build wasn't working. So perhaps that issues is fixed for him too

@garymathews garymathews force-pushed the TIMOB-28439 branch 2 times, most recently from 6403c9c to 275afac Compare May 8, 2021 00:02
Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: Pass

@lokeshchdhry
Copy link
Contributor

@garymathews , With the fix I see an increase in the time from splash to showing the window of 3 - 4 seconds as compared to 2 seconds without. Is this expected ?

@lokeshchdhry
Copy link
Contributor

FR Passed.

@sgtcoolguy sgtcoolguy merged commit 9b319e9 into tidev:master Jun 7, 2021
@build build removed the backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge label Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants