[mob][photos] Precompute max 8 face thumbnails

This commit is contained in:
laurenspriem
2024-05-13 20:47:33 +05:30
parent 2205d21770
commit 36ac637206

View File

@@ -279,10 +279,11 @@ class _PersonClustersState extends State<PersonReviewClusterSuggestion> {
],
);
// Precompute face thumbnails for next suggestions, in case there are
const precomputeSuggestions = 6;
const maxPrecomputations = 10;
const precomputeSuggestions = 8;
const maxPrecomputations = 8;
int compCount = 0;
if (allSuggestions.length > currentSuggestionIndex + 1) {
outerLoop:
for (final suggestion in allSuggestions.sublist(
currentSuggestionIndex + 1,
min(
@@ -302,7 +303,10 @@ class _PersonClustersState extends State<PersonReviewClusterSuggestion> {
);
compCount++;
if (compCount >= maxPrecomputations) {
break;
debugPrint(
'Prefetching $compCount face thumbnails for suggestions',
);
break outerLoop;
}
}
}