Repository: flutter
Issue: [engine] scrolling perfomance regression with merged platform/UI thread.
Labels: from: performance template,P1,team-engine,triaged-engine

### Steps to reproduce

1. `flutter channel master`
2. `flutter run --profile`
3. Scroll vigorously up and down

Reproducible on `master` TOT at the moment : 3ed40f003a92487dfa96833e6a1e1bd7f8ceb677 ❌

The `master` commit that caused it : 81e418dd20f784cae63a5eb9bc234b1332f8e925 ❌

Reproducible on `beta` as well 2e2c358c9b14765c90343af9df11e12c5dfc3e6c ❌

The issue got merged here : https://github.com/flutter/flutter/pull/154020

Last good `master` commit : a4b0d973fb196ba86da5c6ae4d51db40a78a0926 ✅

Not reproducible on `stable`  `3.24.4` ✅


### Code sample

<details open><summary>Code sample</summary>

```dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SingleChildScrollView(
          physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
          scrollDirection: Axis.vertical,
          child: Stack(
            children: [
              const SizedBox(
                height: 1440,
                width: 1000,
              ),
              for (var i = 0; i < 100; i++)
                Positioned.fill(
                  top: i * 20,
                  child: Align(
                    alignment: Alignment.topCenter,
                    child: Container(
                      color: Colors.red,
                      height: 15,
                      child: Center(
                        child: Text(
                          '$i',
                          style: const TextStyle(
                            color: Colors.white,
                            fontSize: 11,
                          ),
                        ),
                      ),
                    ),
                  ),
                ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>


### Performance profiling on master channel

- [X] The issue still persists on the master channel

### Timeline Traces

<details open><summary>Timeline Traces JSON</summary>

[dart_devtools_2024-10-29_21_26_05.195.json](https://github.com/user-attachments/files/17562727/dart_devtools_2024-10-29_21_26_05.195.json)


</details>


### Video demonstration

<details open>
<summary>Video demonstration</summary>


https://github.com/user-attachments/assets/9c66fca2-762e-40fe-bd2b-0f66bb7593f2


https://github.com/user-attachments/assets/b6fa38ef-e136-4834-9428-ef763e5b9432


https://github.com/user-attachments/assets/27eca780-5428-4aeb-bd27-0dd22d6a7947



</details>


### What target platforms are you seeing this bug on?

iOS

### OS/Browser name and version | Device information

`iOS 18.1 (22B83) | iPhone 12 mini`

### Does the problem occur on emulator/simulator as well as on physical devices?

Unknown

### Is the problem only reproducible with Impeller?

No

### Logs

<details open><summary>Logs</summary>

```console
flutter create scrolling
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel master, 3.27.0-1.0.pre.292, on macOS 15.1 24B82 darwin-arm64, locale en-US)
    • Flutter version 3.27.0-1.0.pre.292 on channel master at /Users/nabila/fvm/versions/master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3ed40f003a (14 minutes ago), 2024-10-29 15:45:22 -0400
    • Engine revision 795b5492f1
    • Dart version 3.7.0 (build 3.7.0-78.0.dev)
    • DevTools version 2.40.1
```

</details>