Repository: flutter
Issue: Regressions in stack size per nesting level
Labels: c: performance,perf: memory,P2,team-framework,triaged-framework

The stack size per nesting level benchmark tracks the amount of stack space required for each level of widget nesting. The higher the metric the fewer levels of widget nesting that are possible before Dart will throw a StackOverflow exception.

Since the beginning of the year, the stack size per nesting level has increased from 168 bytes to 224 bytes, roughly decreasing by 1/3d the amount of widget nesting before a StackOverflow exception.

Here are the commits since the beginning of the year that increased the stack space.

FYI @goderbauer 

https://github.com/flutter/flutter/commit/6f09064e785b2bb600a390fe6d8be4ac6775b82b

https://flutter-flutter-perf.skia.org/e/?begin=1689581230&end=1689616568&keys=X02b19cb7dc97f6113b700d7304862cb0&selected=commit%3D35784%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253DMoto_G__4_%252Cdevice_version%253Dnone%252Chost_type%253Dlinux%252Csub_result%253Dstack_size_per_nesting_level%252Ctest%253Dandroid_stack_size_test%252C&xbaroffset=35784

https://github.com/flutter/flutter/commit/07772a3d23fcd0ceae5f6daa3c45f1dc898ed502

https://flutter-flutter-perf.skia.org/e/?begin=1685459911&end=1689671719&keys=X02b19cb7dc97f6113b700d7304862cb0&requestType=0&selected=commit%3D35415%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253DMoto_G__4_%252Cdevice_version%253Dnone%252Chost_type%253Dlinux%252Csub_result%253Dstack_size_per_nesting_level%252Ctest%253Dandroid_stack_size_test%252C&xbaroffset=35784

https://github.com/flutter/flutter/commit/0be7c3f30d647423e3bec24ebbb5f89e03e79b96

https://github.com/flutter/engine/pull/39745

https://flutter-flutter-perf.skia.org/e/?begin=1668639915&end=1689660863&keys=X02b19cb7dc97f6113b700d7304862cb0&requestType=0&selected=commit%3D33434%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253DMoto_G__4_%252Cdevice_version%253Dnone%252Chost_type%253Dlinux%252Csub_result%253Dstack_size_per_nesting_level%252Ctest%253Dandroid_stack_size_test%252C&xbaroffset=35784

https://github.com/flutter/flutter/commit/c4d40cc1528e5404bf358d908807bad1b98d3e90

https://flutter-flutter-perf.skia.org/e/?begin=1668639915&end=1689660863&keys=X02b19cb7dc97f6113b700d7304862cb0&requestType=0&selected=commit%3D33415%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253DMoto_G__4_%252Cdevice_version%253Dnone%252Chost_type%253Dlinux%252Csub_result%253Dstack_size_per_nesting_level%252Ctest%253Dandroid_stack_size_test%252C&xbaroffset=35784

The next commit was from earlier, but increased the stack space required from 160 -> 208 all by itself. This regression wasn't recovered until the Dart VM team re-implemented async/await.

https://github.com/flutter/flutter/commit/c62d103bb651a32f6a502c4ace955a7a05a34510

https://flutter-flutter-perf.skia.org/e/?begin=1606264179&end=1689689212&queries=sub_result%3Dstack_size_per_nesting_level%26test%3Dandroid_stack_size_test&requestType=0&selected=commit%3D28350%26name%3D%252Carch%253Dintel%252Cbranch%253Dmaster%252Cconfig%253Ddefault%252Cdevice_type%253DMoto_G__4_%252Cdevice_version%253Dandroid-24%252Chost_type%253Dlinux%252Csub_result%253Dstack_size_per_nesting_level%252Ctest%253Dandroid_stack_size_test%252C