Skip to content

Cut QtNameWaveDelegate.paint frame work from 19.0 to 12.1 calls/frame via PreparedTextLayout inks - #2353

Merged
trissim merged 1 commit into
mainfrom
fix/sidebar-delegate-wave-attr-hotpath
Nov 28, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/sidebar-delegate-wave-attr-hotpath

Conversation

@trissim

@trissim trissim commented Nov 28, 2026

Copy link
Copy Markdown

Cuts QtNameWaveDelegate.paint Python calls/frame in frame_work from 19.0 (and 25.3 on 8d15381ea) down to 12.1 (-36% below baseline, -52% below 8d15381ea), with 16/20 accent looks.

Changes

  • src/toad/qt/window.py: Declare animation: object | None = None on SidebarItem (matching QtClockedWave) so QtNameWaveDelegate.paint reads item.animation is not None directly without a per-row Python wave_running() call.
  • src/toad/qt/name_wave.py: Delete the redundant _banded_prepared second cache (IDEN-5), override text_inks() for cold super().paint(), and paint already-prepared waving sidebar rows directly through PreparedTextLayout.paint(..., inks) + CE_ItemViewItem (zero QTextLayout cloning/re-layout and zero super().paint()/enum.py overhead per wave-span cache miss).
  • tests/textual/test_name_wave_repaint.py: Update WavingItem and cache assertion for animation / _row_images / bold.
  • tools/frame_work_baseline.json: Ratchet name_wave.QtNameWaveDelegate.paint down 19.0 -> 12.1.

Verification

  • pytest tests/textual/test_name_wave_repaint.py: 3 passed in 0.19s.
  • tools/android/check.sh (bundle_check.py, shipped_run.py, frame_work): 12.1 calls/frame (5.28 entries x 2.3), 0 px sideways drag, 16/20 accent looks, emoji-default: 0.
  • REL_IMPORTS=0.

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