Skip to content

[codex] optimize reel text rebuilds#26

Merged
KickNext merged 10 commits into
mainfrom
codex/reel-text-performance-cache
Jun 24, 2026
Merged

[codex] optimize reel text rebuilds#26
KickNext merged 10 commits into
mainfrom
codex/reel-text-performance-cache

Conversation

@KickNext

@KickNext KickNext commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

This PR reduces unnecessary rebuild, measurement, and per-frame widget work in ReelText without changing the public API, and adds a dedicated example stress screen for visual/performance checks.

  • Settled text now reuses a measured run when text, style, and layout inputs are unchanged, so parent rebuilds do not repeatedly split and measure the same glyph run.
  • Rolling rows now keep the slot row outside the animation tick; the AnimatedBuilder updates viewport sizing/alignment while slots receive the animation directly.
  • Changed plain-text slots paint through a lightweight render-object path that prepares glyph face layouts once and reuses them while the animation progresses.
  • WidgetSpan slots intentionally stay on the widget path because they are live child widgets with layout, baseline, semantics, keys, and selection behavior.
  • The example app now has a fourth Performance tab with a full-screen checkerboard of independent ReelText widgets, theme support, edge fade, optional frame logging, and a tile-count slider that starts at 4 tiles and scales up to the stress maximum.

Notes

  • The temporary chroma/color toggles were removed because disabling them did not improve FPS and made the performance panel noisier.
  • The reverted rolling color-face cache experiment is not part of the final effective diff.

Validation

  • flutter test test/reel_text_test.dart
  • cd example && flutter test test/widget_test.dart
  • cd example && flutter analyze
  • git diff --check

@KickNext KickNext marked this pull request as ready for review June 24, 2026 05:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49978d2cec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/src/reel_text_slots.dart Outdated
@KickNext

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2014318a31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/src/reel_text_slots.dart
Comment thread lib/src/reel_text_slots.dart Outdated
@KickNext

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 33f7d453dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@KickNext

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: b4b30fd99b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@KickNext KickNext merged commit c6bc588 into main Jun 24, 2026
1 check passed
@KickNext KickNext deleted the codex/reel-text-performance-cache branch June 24, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant