[pigeon] Switch Indent class to manage all writes with a StringBuffer#11133
[pigeon] Switch Indent class to manage all writes with a StringBuffer#11133auto-submit[bot] merged 4 commits intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the Indent class to manage all write operations with an internal StringBuffer instead of writing directly to an IOSink. This change aims to improve performance by buffering writes and reducing I/O operations. Consequently, the Indent class constructor no longer accepts a sink, and its toString() method is now used to retrieve the generated string. All call sites have been updated to instantiate Indent, use it for string construction, and then write the final content from indent.toString() to the target sink.
tarrinneal
left a comment
There was a problem hiding this comment.
This should also probably have a version bump.
Do you know if the formatting changes at all before the format tool runs?
|
I was wondering, when you have serveral in-flight PRs, do you just bump the version in each of them, even though you know all but one will be wrong? Just a game of merging main branch, bump version again; merge main branch, bump version again? |
|
I usually do, that way whatever is ready first can land. I know when I review, seeing all passing tests helps me know something is ready to be looked at. |
|
Version bumped. |
flutter/packages@faa4e22...9083bc9 2026-03-03 [email protected] [video_player] Stop display link on dispose (flutter/packages#11118) 2026-03-02 [email protected] Roll Flutter from 1141b2b to 46fb721 (38 revisions) (flutter/packages#11162) 2026-03-02 [email protected] [pigeon] Switch Indent class to manage all writes with a StringBuffer (flutter/packages#11133) 2026-03-02 [email protected] Add LeanCode and contributors to AUTHORS (flutter/packages#11134) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#183164) flutter/packages@faa4e22...9083bc9 2026-03-03 [email protected] [video_player] Stop display link on dispose (flutter/packages#11118) 2026-03-02 [email protected] Roll Flutter from 1141b2b to 46fb721 (38 revisions) (flutter/packages#11162) 2026-03-02 [email protected] [pigeon] Switch Indent class to manage all writes with a StringBuffer (flutter/packages#11133) 2026-03-02 [email protected] Add LeanCode and contributors to AUTHORS (flutter/packages#11134) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
We change the Indent class to not accept an IOSink. Instead, it manages all writes in its own StringBuffer, and then its
toString()method can be used to extract out the written text.This dramatically reduces the number of write operations sent to the OS. Functionally, it is a no-op, but should have various performance improvements. Generating Dart files may be overall faster.
Using this PR, I find that the number of file operations is reduced from 166k operations to 3142 operations. 🎉
Fixes flutter/flutter#182958
Pre-Review Checklist
[shared_preferences]///).