Perf round 4: lazy chat sessions list
Chat sections are slivers: a lazy, keyed SliverList under the same heading, with SliverAnimatedExtent reproducing the clipped AnimatedSize for open, close and arriving rows. The first Chat tab visit no longer builds every row (150 chats: worst build frame 116 ms to 19 ms).
This commit is contained in:
@@ -111,8 +111,11 @@ void main() {
|
||||
'rowRebuilds=${rebuilds.of(ChatSessionRow)} '
|
||||
'totalRebuilds=${rebuilds.total}',
|
||||
);
|
||||
// One row per change, not all 200 (10,000 row rebuilds before).
|
||||
expect(rebuilds.of(ChatSessionRow), 50);
|
||||
// Only the rows on screen are built (the list is lazy) ...
|
||||
expect(built, lessThan(40));
|
||||
// ... and at most the changed row rebuilds per change, not all 200
|
||||
// (10,000 row rebuilds before); a change to an offscreen row builds none.
|
||||
expect(rebuilds.of(ChatSessionRow), inInclusiveRange(1, 50));
|
||||
});
|
||||
|
||||
testWidgets('gallery: open a visit with 500 artifacts', (tester) async {
|
||||
|
||||
Reference in New Issue
Block a user