Repository: flutter
Issue: TextFormField focus consumes enormous system resources on simulator & iPhone
Labels: a: text input,platform-ios,framework,c: performance,f: focus,P2,team-ios,triaged-ios

## Details

1.  Please tell us exactly how to reproduce the problem you are running into, and how you measured the performance.

- When textFormField is focused something goes very wrong!
- When using iOS simulator, computer resources are drained, CPU temps skyrocket, runner consumes about 10% CPU
- Macbook Pro soon becomes unusable until textFormField is unFocused
- Occurs the same on physical devices- tested on iPhone 6, iPhone 12 Pro Max, & Samsung Galaxy 9
- Below provided picture is from iPhone 6 running runner in xCode, all others produce the same result in varying degrees!

2.  Please attach a small application (ideally just one main.dart file) that
     reproduces the problem. You could use https://gist.github.com/ for this.

- [Here](https://stackoverflow.com/questions/74002668/issue-with-textformfield-textfield-triggering-unnecessary-rebuilds-when-focused) is my code of the application I'm trying to build and issue gone awry
- [Here](https://docs.flutter.dev/cookbook/forms/validation) is a link to the Flutter textFormField example. This code is what I was running for all the above tests and this Flutter example is what I was running for the below resource drain picture!

Again, I will reiterate. I tried to see if this was a problem with MY code, IT IS NOT! Flutter example app with NOTHING in it except a button and field produce these results!

Here is the flutter demo app for easy reference:
```
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    const appTitle = 'Form Validation Demo';

    return MaterialApp(
      title: appTitle,
      home: Scaffold(
        appBar: AppBar(
          title: const Text(appTitle),
        ),
        body: const MyCustomForm(),
      ),
    );
  }
}

// Create a Form widget.
class MyCustomForm extends StatefulWidget {
  const MyCustomForm({super.key});

  @override
  MyCustomFormState createState() {
    return MyCustomFormState();
  }
}

// Create a corresponding State class.
// This class holds data related to the form.
class MyCustomFormState extends State<MyCustomForm> {
  // Create a global key that uniquely identifies the Form widget
  // and allows validation of the form.
  //
  // Note: This is a GlobalKey<FormState>,
  // not a GlobalKey<MyCustomFormState>.
  final _formKey = GlobalKey<FormState>();

  @override
  Widget build(BuildContext context) {
    // Build a Form widget using the _formKey created above.
    return Form(
      key: _formKey,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          TextFormField(
            // The validator receives the text that the user has entered.
            validator: (value) {
              if (value == null || value.isEmpty) {
                return 'Please enter some text';
              }
              return null;
            },
          ),
          Padding(
            padding: const EdgeInsets.symmetric(vertical: 16.0),
            child: ElevatedButton(
              onPressed: () {
                // Validate returns true if the form is valid, or false otherwise.
                if (_formKey.currentState!.validate()) {
                  // If the form is valid, display a snackbar. In the real world,
                  // you'd often call a server or save the information in a database.
                  ScaffoldMessenger.of(context).showSnackBar(
                    const SnackBar(content: Text('Processing Data')),
                  );
                }
              },
              child: const Text('Submit'),
            ),
          ),
        ],
      ),
    );
  }
}
```

4.  Switch flutter to master channel and run this app on a physical device
     using profile or release mode. Verify that the performance issue can be
     reproduced there.

- Done, switched to master
- Done, ran Flutter upgrade
- Done, ran this on physical device
- SAME ISSUES
...
- Also tried running in release mode on physical device with no debugging or cpu logging. I have no idea if the problem persists in release mode.
- 
Problem occurs on all platforms and devices.

This must be a huge issue and I know there are a lot of people with "textFormField rebuild issues". I can't be the only one who has seen this issue.

The fact that this occurs in the Flutter demo app for textFields is alarming!

PHOTO - running on iPhone 6

[![text-Form-Field-issue.png](https://i.postimg.cc/PqG2pfKs/text-Form-Field-issue.png)](https://postimg.cc/BjgxR0dM)

Look, I LOVE Flutter. It's the best. So forgive me for sounding ungrateful, I'm actually very frustrated, this seems like something that should have been fixed a LONG TIME AGO. And there should be no reason why a textField uses 60% of a CPU on a physical device even in debug mode.

Is there any hope for this issue?