• 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
..
_binding_io.dart Loading commit data...
_binding_web.dart Loading commit data...
_goldens_io.dart Loading commit data...
_goldens_web.dart Loading commit data...
_matchers_io.dart Loading commit data...
_matchers_web.dart Loading commit data...
accessibility.dart Loading commit data...
animation_sheet.dart Loading commit data...
binding.dart Loading commit data...
controller.dart Loading commit data...
deprecated.dart Loading commit data...
event_simulation.dart Loading commit data...
finders.dart Loading commit data...
frame_timing_summarizer.dart Loading commit data...
goldens.dart Loading commit data...
image.dart Loading commit data...
matchers.dart Loading commit data...
mock_canvas.dart Loading commit data...
mock_event_channel.dart Loading commit data...
nonconst.dart Loading commit data...
platform.dart Loading commit data...
recording_canvas.dart Loading commit data...
restoration.dart Loading commit data...
stack_manipulation.dart Loading commit data...
test_async_utils.dart Loading commit data...
test_compat.dart Loading commit data...
test_default_binary_messenger.dart Loading commit data...
test_exception_reporter.dart Loading commit data...
test_pointer.dart Loading commit data...
test_text_input.dart Loading commit data...
test_text_input_key_handler.dart Loading commit data...
test_vsync.dart Loading commit data...
tree_traversal.dart Loading commit data...
widget_tester.dart Loading commit data...
window.dart Loading commit data...