Files
jobtrackingapp/docs/redesign/phase-6/p6-04/README.md
T

17 KiB
Raw Blame History

P6-04 — Performance and component reuse review

Scope, baseline and evidence method

Measure representative existing workflows and audit real reuse/fetch/save/preview owners before proposing changes. The Phase5 final scope supplies historical finite Board200/1,000 membership and render observations, native CV16/36 and Settings8/24 output, and retained reliability debt. Its1,040/1,612ms Board render measurements are historical single-run data, not a budget or directly comparable current result. No supported-load/CPU/memory/latency budget was previously approved.

Fresh native measurement is owned by the responsive audit performance case. The current post-Career-spacing-repair run records Chromium 151.0.7922.34, a1280×720 CSS-pixel viewport, Windows win32, production static export, Release API, isolated synthetic SQLite, prebuiltExport: true and serverReuseAllowed: false from the actual invocation. It records hard-navigation time to the stated assertion, network requests/resource transfer/duration, long-task/layout-shift observations and CDP heap/DOM/layout/task metrics. Counts and exact API-to-rendered ID parity are asserted at200 and1,000; the separate unchanged diagnostics lane checks its seeded collection. Filtering never silently caps the Board.

The performance case covers initial Jobs, Dashboard, Analytics6/24months, job details, long-CV initial settled preview, CV-only edit including existing800ms autosave, Board API/render at200/1,000, corresponding Table navigation and filtered Board. A heading-only ready milestone measures route presentation, not complete report/list data settling; CV and Board milestones wait for the stated actual preview/count. Hard navigation includes boot/auth and is distinct from client route transitions, search debounce and React rendering counts. Single-run CDP heap samples cannot establish a memory leak or physical-device capacity.

The extended diagnostic measures actual client Board→Table→Board activation while retaining994 matches, typed search through the existing debounce to exactly one result, and Jobs→Dashboard navigation to the real1,000 tracked-job value. An unchanged document performance.timeOrigin proves these are client transitions. Request paths include query strings for these interactions. The retained first153/157 ordinary attempt loaded an earlier diagnostic before that test-only extension. The fresh post-CSS standalone run includes the extension; the final159-case full run is now executing with the same extended case. Extension adds evidence within the existing browser case, not an application change or another case count. Final integrated acceptance remains separate until its actual result is recorded.

Two preliminary diagnostic failures are retained: the Dashboard's determinate onboarding progress indicator was incorrectly treated as a loading indicator, and identical profile bullets normalized to a one-page document. The fixture now supplies eight distinct roles with four uniquely identified bullets each and asserts actual multi-page readiness. These were diagnostic milestone/fixture corrections, not product defects, renderer changes or relaxed pagination assertions.

The fresh post-CSS standalone diagnostic passes1/1, with zero skips/retries/flaky results. Performance manifest and exact command/results record the2026-10-11 08:46:49.646–08:47:46.501 UTC invocation, raw report SHA-256 53d65dfd5a7352a90bddc788114fb2d7ae3fd8aba9e1a53375a5f4bffe1c8f8a. Its browser report started08:46:50.191 UTC and lasted56.276seconds. Integrated regression is separate in the aggregate validation. No comparative optimization or supported-load budget is claimed.

Measured workflow / milestone Observed milliseconds
Initial Jobs heading plus successful list response 673
Dashboard tracked-job link plus stats response 905
Analytics6 /24months heading plus stats response 767 /770
Job workspace heading plus owned workspace response 923
Four-page CV: all visible page frames ready, preview not busy 1,326
CV-only edit persisted and Saved, including existing autosave delay 996
Complete Board200 /1,000 API-to-DOM membership 1,026 /1,657
Table200 /1,000 heading plus list response 571 /589
Filtered Board194 /994 cards 958 /1,611
Client Board→Table /Table→Board, retaining994 matches 319 /695
Typed search through debounce to exactly one matching card 1,490
Client Jobs→Dashboard with1,000 tracked-job metric 184

Board200 response is237,273 bytes/24ms; Board1,000 is1,181,982 bytes/21ms. Board render long tasks are73/92/96ms versus63/397/264ms, with zero observed eligible layout shift at the Board milestones. Initial Jobs records a137ms long task and sampled shift0.0546968994; long-CV initialisation records a52ms long task and shift0.0128848606. Dashboard performs two reminder reads and two auth/me reads from separate shell/onboarding/report owners and records shift0.0867047106 at its ready milestone. Recorded shifts vary by route and sampling milestone; they remain observations rather than a full-session CLS certification. Automated action times include control activation/assertion overhead. These finite results preserve uncapped membership but justify separately scoped Board capacity and report-read/layout investigations.

The third preliminary failure was a diagnostic literal expecting 1000 rather than the existing English-formatted 1,000 accessible Dashboard metric. It is corrected without changing the metric or formatter; that failure's complete output folder/report/log is archived. The two earliest diagnostic failures retain exact reports/logs but some old attachment paths were overwritten before complete-folder archival was added.

Static exported bundle snapshot

Source-review inspection of the existing local export found buildID nlP_a9RD_LvG_Wn2riffj,53 JavaScript files and 3,233,467 aggregate raw bytes under out/_next/static. This export predates current Phase6 corrections and has no verified current-source provenance. The five largest chunks were432,558;417,647;257,695;228,034;207,255raw bytes; individually gzip-compressing the first produced128,684bytes. These are static artifact observations, not initial-route transfer, effective server compression or current-build measurements. Summing lazy chunks does not describe first load.

The actual .next/build-manifest.json is ignored/generated and must be sampled again after the final production build rather than committed or treated as a stable documentation link. App already lazily imports the main private domain routes, AddJobModal/commands and other substantial surfaces; JobTable separately lazily imports KanbanBoard. Suspense boundaries exist. No evidence currently justifies another framework/chunking/dependency rewrite. Fresh bundle/network observations belong in the manifest, with actual SHA/build identification.

Current verified production build 2LDblja_XnSBWSuY6ys_V has53 exported JS files:3,234,867 aggregate raw bytes and940,065 summed individual gzip bytes. The manifest records every chunk SHA256; these include initial and lazy assets. Local browser routing blocks non-local network and affects caching, so hard-navigation resource transfers do not certify deployed compression or warm-cache behavior. The older unverified export above is attributed history and not a matched before/after comparison.

ResourceTiming reports zero transferSize for the cross-origin API entries because that measurement is unavailable; it does not imply zero-byte API responses. The separate Board bytes field counts actual response-body bytes. Exported JavaScript totals and same-origin resource timing have their own stated scope. CDP heap/DOM values include retained navigation/iframe documents and are context snapshots, not isolated route footprints, allocation totals or a leak diagnosis. Layout-shift observations end at the stated milestone, not the full session lifetime; no unsupported pass/fail budget is attached to them.

Fetch, computation and preview source audit

Actual owner Existing efficiency/protection Candidate or legitimate repeated work; required evidence before change
Jobs JobTable/KanbanBoard/jobsQuery Shared normalized committed filters;250ms debounced Board query; Table loader disabled in Board; page-owned Table read; memoized row models/selection/group derivation and latest-resource sequence Board is complete-array O(N) response/render plus grouped array sorting; no virtualization/cap. Native request/membership/timing/DOM/heap observations at200/1,000 establish finite envelope. Bigger backend projection/virtualization is a separately scoped compatible design, not implied by a slow-looking screenshot
DashboardView/Analytics One report owner; summary stats/overview/reminders parallel, independent trends analytics/tags/tag-trends parallel; charts derived via useMemo; Analytics skips reminder feed and uses URL months Shell independently requests the same reminder feed for its badge on mount/60second interval. This source overlap serves two responsibilities; measure actual requests/bytes and error/lifetime needs before sharing a cache. Month changes should not be miscounted as initial duplicates; no fabricated new metrics
useViewResource Latest-request sequence prevents superseded results, keeps existing data during refresh, normalizes401/403 versus unavailable errors, enabled loader boundary Dependency changes rerun load intentionally; loaderref prevents callback identity alone from being the dependency. No transport-abort/memory-leak claim follows from this hook; retain existing shared Axios session/owner cancellation. Replacing all loaders is unsupported
useCompanies Owner-keyed module cache and shared inflight request, auth-user event invalidation, explicit cache-bust reload Other dedicated Companies/command screens have distinct reads. Do not create shared cross-account cache or assume every company loader can be merged; compare freshness/invalidation/command cancellation consumers first
Job ApplicationWorkspacePage/ApplicationAssets/ApplicationIntelligence Overview load by job; sections own real artifact/intelligence reads; component boundaries keep drafts/history/provider operations separate Source-level duplicate-like attachment/CV reads can have legitimate consumer/lifetime semantics. Legacy useJobWorkspaceBaseData is not evidence of mounted production work without an actual caller. Measure the current routed workspace; do not optimize unreachable historical hooks
CvBuilderEditor Variant/themes/outline load in parallel;300ms preview debounce/request sequence, retained latest good HTML/error/Retry,800ms save debounce/serialized queue/version conflict. Content stays mounted;900px pane switch changes visibility, not editor identity. Existing hidden physical ruler/paginated pages preserve rendering fidelity Long document has one hidden measurement iframe plus page iframes with complete generated HTML. Layout/heap/long-task cost needs actual measured page count/fixture and source-equivalent exports. No needless remount/global renderer/virtualization change merely to reduce iframe count; keep original16/36+8/24 oracle
I18nProvider and locale-aware read consumers Source-review baseline defines t inline, recreated whenever provider renders; locale/error text intentionally refreshes on locale change PF-01 tested hypothesis: feedback toast triggers another locale-dependent load. The actual-provider/CompaniesTable regression observes one initial GET, no extra GET after toast, then exactly one locale-driven GET after switching to NB. The tested trigger is disproven; no translator memoisation/source change is justified
ToastProvider Stable useCallback toast and memoized context value; measured bottom clearance prevents controls being obscured Real-provider stability test confirms its toast update does not repeat the tested Companies read. Do not infer an automatic fetch loop from inline t alone or generalize one route to every possible provider rerender

The source baseline's exact [t] request/resource consumers include CompaniesTable, RemindersView, NotificationsPopover, SessionsSettingsCard, SettingsView, TwoFactorSettingsCard, AdminAuditPage, AdminSystemPage, CareerProfilePage, CorrespondenceInboxPage, CvBuilderPage, OfferComparisonPage, OperationsPage and ProfilePage. Dashboard resources, JobTable/Board and job asset/intelligence/workspace callbacks also include translator dependencies alongside real state. ImportExportJobs has a harmless [t] memo, not a network effect. These are a caller map, not measured redundant requests. The tested toast trigger adds none; retain current dependencies and genuine locale/error-text refresh behavior.

Component reuse and maintainability

Pattern Reuse decision / preservation boundary
Page hierarchy, section surfaces, controls and feedback Retain PageHeader/PageSection, semantic theme, MUI Button/TextField/Table/Dialog/Drawer, ViewStateNotice and existing toast/confirm/prompt. P6 scoped company error/language feedback and Settings semantics use those owners. No new presentation framework or duplicate notification stack
Resource/state loaders useViewResource and domain-local useAsset/useIntelligence overlap superficially; their retry/cancellation/setData/save consumers differ. No consolidation solely to reduce line count. Fresh evidence of a repeated failure or real shared behavior is required before extraction
Dashboard/Analytics reports Existing shared DashboardView reporting mode is already reuse; no duplicate chart fetching owner/new chart library
Jobs/Table/Board Shared query semantics and density remain, with table versus full-board data shape intentionally distinct. Sharing state never means one API response or capped Board membership
CV editor/library/templates Existing CvTemplateGallery/CvCustomizeTab/settings client are reused; one editor/save/history/renderer remains. Printed templates keep their own physical tokens; app density does not change PDF layout
AI review Domain differences preserve explicit source/destination, draft versus persisted item versus autosave and stale token protection. Share layout only after proving all consumers; no universal Apply or automatic model invocation
Settings/account/providers/admin Existing independent subcard/API scopes and roles remain. Remaining legacy page presentation migrates in Phase7; aggregate admin metrics/new Notifications/Documents projections require real contracts first

Bounded outcome and remaining work

This checkpoint supplies source findings and the executed reproducible native baseline. Runtime timings, large-result bytes, resource observations, long tasks/layout shifts and heap snapshots belong to the fresh manifests. No invented performance budget, unbounded capacity claim, React rerender count, comparative gain or leak diagnosis is supplied.

PF-01 has a meaningful read-count/localisation regression using the actual provider/Companies owner; its toast-trigger hypothesis is disproven and existing source is retained. It is included in the final521-case frontend run (85 suites), separately from the native diagnostic. Measured shell/report request overlap is retained for bounded owner/freshness-aware investigation rather than an unqualified cache. Leave major backend/Board/document optimization to an explicit supported-workload design.

Retain Board/reliability/manual/rendering debt, historical language/notification/Rules500 causes, IF-CV-UNSAVED-01 and production font/device/ingress/recovery gates. Original document/page/source/owner/proposal contracts are protected by the 57-group matrix. Current commit/push verification is the Phase6 ledger. Production stays NO-GO; no Phase7 or Phase8 implementation occurs here.