perf(startup): add release timing harness#966
Merged
limityan merged 1 commit intoMay 30, 2026
Conversation
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.
Summary
devtoolsfeature and update WebDriver routes to Axum 0.8 path syntax.--bitfun-startup-bgvariable so light-theme startup no longer flashes from a dark splash fallback to a white splash.Refs #949
Performance Data
Scenario: Windows local release-fast build with production web bundle, release-fast Rust profile, embedded WebDriver, 80 generated session metadata rows, and one 80-turn long session with 160 synthetic tool results.
Latest post-rebase sample from this PR:
first_script_evalbefore_renderdurationapp_effect_mountedmain_window_shownnon_critical_init_doneinteractive_shell_readyStartup API aggregate in the same sample:
get_configinitialize_aigit_is_repositoryremote_get_workspace_infogit_get_repository_basicEarlier repeat samples on the same release-fast branch before the final upstream rebase showed startup variance rather than a stable startup reduction:
interactive_shell_readymain_window_shownOne earlier cold-ish long-session background hydrate outlier hit about 1535.9 ms; backend logs attributed it to reading 80 turn files with about 1.9 MB raw tool-result text. The perceived first frame still stayed near the 50 ms range because only the latest 3 turns are restored initially.
This PR should be evaluated as measurement infrastructure plus startup visual consistency. It does not claim an end-to-end startup reduction; the data points to follow-up optimization work around startup API duplication and early initialization.
Risks / Notes
window.__BITFUN_STARTUP_TRACE__surface exposes only sanitized phase/API aggregates, not raw request payloads or workspace paths, and is limited to dev or explicit perf WebDriver runs.devtoolsnow enables embedded WebDriver for release-fast E2E. End-user release builds are unaffected unless that feature is explicitly enabled.data-testidattributes are test-only selectors;data-session-titlemirrors already visible UI text.Verification
pnpm run type-check:webpnpm --dir src/web-ui run test:run src/shared/utils/startupTrace.test.ts src/infrastructure/theme/core/ThemeService.test.tspnpm run check:repo-hygienecargo check -p bitfun-desktop --features devtools(passes with existingparse_clipboard_path_segmentsunused warning)pnpm run desktop:build:release-fast(passes with existing Vite chunk warnings and the same Rust warning)E2E_TEST_WORKSPACE=<workspace> BITFUN_E2E_PERF_SESSION_ID=perf-long-session-000 pnpm run e2e:test:perf:release-fastgit diff --check gcwing/main...HEAD