• Kris Pypen's avatar
    Fix: performance improvement on golden test comparison (#142913) · 2f117c54
    Kris Pypen authored
    During golden test image comparison 2 lists of a different type are compared with the method "identical", so this will never be true. The test image is a _Uint8ArrayView while the master image is an Uint8List. So that results in always a heavy computation to get the difference between the test and the master image.
    
    When you run this test snippet I go from 51 seconds to 14 seconds:
    ```dart
    import 'package:flutter/material.dart';
    import 'package:flutter_test/flutter_test.dart';
    
    void main() {
      for (int i = 0; i < 100; i++) {
        testWidgets('Small test', (WidgetTester tester) async {
          await tester.pumpWidget(Directionality(textDirection: TextDirection.ltr, child: Text('jo')));
          await expectLater(find.byType(Text), matchesGoldenFile('main.png'));
        });
      }
    }
    ```
    2f117c54
Name
Last commit
Last update
.github Loading commit data...
.vscode Loading commit data...
bin Loading commit data...
dev Loading commit data...
examples Loading commit data...
packages Loading commit data...
.ci.yaml Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CODEOWNERS Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
PATENT_GRANT Loading commit data...
README.md Loading commit data...
TESTOWNERS Loading commit data...
analysis_options.yaml Loading commit data...
dartdoc_options.yaml Loading commit data...
flutter_console.bat Loading commit data...