Repository navigation
App tests stop paying for imports, palette waits and settings resolves they never needed - #1592
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd
Each forked app test imported the screens and widgets it mounted cold (toad.screens.comms, widgets.comms_chat, wire_history, welcome, session_tabs: 51 modules, 0.21 s cold), so every one of 594 tests paid again for imports the template could hold once. Imported before the fork, the smallest app tests in test_initial_session_title.py go from 1.43-1.98 s to 1.18-1.23 s each, and the template's own first test from 10.6 s to 6.2 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd
keys_held and kept asked saved_key for every setting, and saved_key resolved the containing record's value (DeclaredField.owner_type -> ObjectState.get_resolved_value) per field, only to learn which class owns the field's file key. Every field of one level shares that owner, so saved_keys resolves it once and maps every field to its key. Opening settings at launch goes from 48.0 ms to 13.7 ms for a populated toad.json (15.3 to 11.3 ms for an empty one); the keys held are unchanged. tests/model/test_saved_settings.py and the settings, forms and keymap tests: 36 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Numbers first. A tiny app test in
tests/textual/test_initial_session_title.pycost 1.43–1.98 s, and about 0.05 s of that was the test body. The rest was Toad booting. After this PR plus OpenHCSDev/textual#256 they cost 0.93–1.04 s each. The template's first test (its warm-up) went from 10.6 s to 6.2 s.Measured with timestamps along one test's path (runner → fork → child pytest → app construct → run_test → start worker → session ready → body → teardown → reap):
Commits
TEXTUAL_FPS=1000). Wheel walks no longer wait a 7 ms tick per event. Fulltests/textualon 8 workers: 221 s against main's 231 s. Small (4%), kept.ToadDatabase.preparecosts 4 ms instead of its cold build. Small tests: 1.43–1.98 s → 1.18–1.23 s.saved_keyresolved the containing record's value per field (DeclaredField.owner_type→ObjectState.get_resolved_value) only to learn the owner class. One resolve per level now. Opening a populatedtoad.json: 48.0 ms → 13.7 ms at every launch. Keys held unchanged; settings, forms and keymap tests: 36 passed.Paired change, outside this repository: OpenHCSDev/textual#256.
HeadlessDriverwaited out the full 0.25 s palette query (textual_colours.py:354) for replies to writes that go nowhere. With it, small tests are 0.93–1.04 s.What more workers does not fix
On 12 workers the suite took 376 s, against 221 s on 8. Each test forks its own route observer and render workers, so 12 workers oversubscribe 12 cores. The lever is per-test cost, not worker count.
Still per test, next
_prewarm_conversation_css. Stylesheets parse per app, and no module-level cache holds rule sets.🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd