Skip to content

Optimize WaveWidget painting for long durations#67

Merged
RockerFlower merged 1 commit into
masterfrom
codex/optimize-wave-painting
Jul 8, 2026
Merged

Optimize WaveWidget painting for long durations#67
RockerFlower merged 1 commit into
masterfrom
codex/optimize-wave-painting

Conversation

@RockerFlower

@RockerFlower RockerFlower commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

  • bump package version to 0.2.5 for the issue Long durations make animations stutter #53 performance fix
  • reduce per-frame wave path work by sampling the curve instead of adding one point per pixel
  • reuse painter path and gradient shader state, and isolate WaveWidget with a repaint boundary
  • avoid recreating animation controllers when runtime-only paint parameters such as amplitude change
  • add issue Long durations make animations stutter #53 regression coverage and a manual benchmark test

Fixes #53

Benchmark

Scenario: issue #53 reproduction config, Flutter 3.7.12 via FVM, 1440x300 WaveWidget, four gradient layers, durations 43000/43000/45000/45000, waveAmplitude 180, waveFrequency 1, 1800 pumped frames.

Command:

fvm flutter test tool/issue_53_benchmark_test.dart --reporter expanded

Revision Average pump time
master / 0.2.4 baseline 0.258 ms/frame
this branch / 0.2.5 0.128 ms/frame

Result: about 50% lower frame pump time, roughly 2.0x faster in this benchmark.

Verification

  • fvm flutter analyze
  • fvm flutter test
  • fvm dart pub publish --dry-run: 0 warnings
  • fvm flutter test tool/issue_53_benchmark_test.dart --reporter expanded

@RockerFlower RockerFlower merged commit 618be5a into master Jul 8, 2026
3 checks passed
@RockerFlower RockerFlower deleted the codex/optimize-wave-painting branch July 8, 2026 09:06
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.

Long durations make animations stutter

1 participant