Repository navigation
Description
What happened?
A cold load of the sign-in page downloads, parses and runs the code of every dashboard route and all three locales before it paints the form. On main eee0a1098 a fresh browser context opening /log-in fetches 46 script files with 2,115,972 bytes transferred (7.41 MB decoded). PERF-P10 (services/platform/tests/manual/suites/performance.md) expects about 34 files and at most 2.0 MB. The build's own check prints Cold-load JS: 44 preloaded modules, 2064 KB gzip. The box records a 1.93 MB baseline from #3498.
All numbers come from a local production build (bun run build), served by vite preview with gzip and the real backend, on synthetic data with no egress. Medians are shown with min–max; n=10 per row.
Flow on main eee0a1098 |
Visible | module-load mark |
Long tasks | JS fetched |
|---|---|---|---|---|
Cold /log-in: password field painted |
1,201 ms (1,046–1,327) | 1,016 ms | 470 ms | 46 files, 2,066 KB |
Cold /dashboard/{org}: the chat's Send message painted |
1,804 ms (1,628–2,811) | 1,124 ms | 1,152 ms | 46 files, 2,066 KB |
| Warm reload of the same (HTTP cache warm) | 1,384 ms (1,250–1,729) | 788 ms | 886 ms | 46 files revalidated, 13 KB |
Most of the time before the sign-in form paints is spent loading the bundle. The module-load mark (app/lib/perf/cold-load-trace.ts) lands at about 1.0 s, and a warm reload pays most of that again.
Where the bytes come from. The 44 preloaded modules, attributed to their sources through the build's sourcemaps (entry-analyze.mjs, Node zlib level 6, 2,048 KB in all):
| Chunk | gzip | What is in it |
|---|---|---|
index-*.js (the entry) |
1,178 KB | Every route and feature: • app/routes/dashboard ~171 KB• features/settings ~138 KB• chat ~55 KB• tasks ~43 KB• automations ~32 KB• documents ~24 KB• conversations, projects, analytics, home, skills ~11–18 KB eachPlus the libraries they reach: • recharts ~64 KB • parse5 ~33 KB • react-datepicker ~28 KB • ajv ~26 KB • yaml ~26 KB • jszip ~25 KB • motion-dom ~24 KB • luxon ~19 KB • he ~18 KB • date-fns ~16 KB • shiki's textmate ~11 KB • @dnd-kit/core ~10 KB |
read-state-*.js |
391 KB | The platform catalogs: • messages/fr.yml ~109 KB• de.yml ~107 KB• en.yml ~94 KBPlus i18next ~12 KB |
vendor-core-*.js |
231 KB | React, the router and query stack, Sentry. Also: • @xyflow/react + @xyflow/system ~37 KB• @tanstack/table-core ~15 KB |
vendor-katex-*.js |
85 KB | KaTeX, through the markdown renderer (the build already warns) |
There are four causes:
- No route-level code splitting.
tanstackRouter()inservices/platform/vite.config.tsruns withoutautoCodeSplitting. None of the 125 route components underapp/routesis a.lazy.tsxroute, and none usescreateLazyFileRouteorlazyRouteComponent. So the entry chunk carries every route's component and everything it imports. The sign-in page runs the settings, chat, tasks, automations, documents and analytics code (recharts included) before it paints. - Every locale is in every cold load.
services/platform/lib/i18n/i18n.tsimportsen.yml,de.ymlandfr.ymlstatically, plusde-CHthrough an eager glob. That's becauseinitServiceI18n(packages/ui/src/i18n/init-service.ts) takes all three base bundles up front and deep-merges them at start. That's about 310 KB gzip (1.06 MB of minified JS) per load, and a session only needs one of the three catalogs, about 94–109 KB. coreChunk()matches any/react/path.@xyflow/react, the flow-diagram library, lands invendor-core, which every page preloads, and rolldown pulls its dependency@xyflow/systemin with it.@tanstack/table-corerides along on the@tanstackmatch. Together that's about 52 KB gzip on the sign-in page, and it stays in the cold set even with routes split (experiment R).- KaTeX is reached statically from the markdown renderer. This one is already known:
check-entry-budget.tsreports it.
Two experiments. These are evidence, not proposed patches. Each was run ABBA against the same commit, with the same backend, database and fixture, one block at a time, n=10 per arm.
R: tanstackRouter({ autoCodeSplitting: true }), one line. The build passes with Cold-load JS: 65 preloaded modules, 877 KB gzip, and KaTeX leaves the cold set.
| main | R | |
|---|---|---|
Cold /log-in: JS fetched |
46 files, 2,115,972 B | 70 files, 921,350 B |
Cold /log-in: password field painted |
1,192 ms (1,074–1,522) | 815 ms (697–921) |
…module-load mark |
974 ms | 598 ms |
| Cold dashboard: Send message painted | 1,755 ms (1,653–2,050) | 2,080 ms (1,874–2,203) |
…module-load → router-loaded |
1,100 → 1,196 ms | 633 → 1,562 ms |
| …JS fetched by the time the page settles | 46 files, 2,066 KB | 214 files (209–221), 1,606 KB |
| First visit of All projects in-app, hover then click (n=6) | 126 ms (115–160) | 142 ms (128–169) |
| First visit of Knowledge, hover then click (n=6) | 119 ms (109–165) | 144 ms (132–177) |
| First visit of Knowledge, click without hover (n=6) | 124 ms (111–154) | 134 ms (114–156) |
R makes the sign-in page faster and the signed-in landing slower. Once the entry has run, the router fetches the chat route's chunks in a second wave. In the first sample's waterfall, 133 requests start 0.6–0.8 s in, and 146 of the 213 files are under 2 KB. That moves router-loaded from about 0.1 s after module-load to about 0.9 s after it. Route splitting has to avoid that waterfall: for example, preload the shell and the landing route for a signed-in session and keep shared code in fewer chunks. It also has to come with locale loading (with R, the three catalogs are 37% of the remaining cold set).
L: the de and fr imports pointed at en.yml. This is the upper bound of what an English session gains. It is not an implementation, since German and French users would get English. The build gives Cold-load JS: 44 preloaded modules, 1839 KB gzip.
| main | L | |
|---|---|---|
Cold /log-in: JS fetched |
2,115,972 B | 1,886,954 B |
Cold /log-in: password field painted |
1,268 ms (1,082–1,554) | 1,172 ms (1,122–1,287) |
| Cold dashboard: Send message painted | 1,976 ms (1,573–2,368) | 1,710 ms (1,559–1,839) |
…module-load mark |
1,184 ms | 1,008 ms |
| …JS heap after load | 44 MB | 41 MB |
Limits
- The host is a VM cgroup capped at 2 CPUs and 4 GiB, and everything runs on localhost. A real network adds transfer time on top of all of this, so the absolute times here undercount it.
- Other tenants used 0.35–0.48 CPU on average over the sample windows (p90 of the 1-s intervals ≤ 0.68), and steal stayed ≤ 0.09.
- The two ABBA runs saw different host load, so compare each table within itself.
- The service worker was blocked in the harness, and
vite previewserves assets withCache-Control: no-cache, so warm loads revalidate every file. - Neither experiment ran the unit, browser or e2e suites, or visited any route other than sign-in, chat, All projects and Knowledge.
Steps to reproduce
-
On main
eee0a1098, runbun install --frozen-lockfile, thenbun run buildinservices/platform. The log printsCold-load JS: 44 preloaded modules, 2064 KB gzipandstill preloaded, should become lazy: assets/vendor-katex-*.js. -
Serve
dist/(vite preview, as in the prod-build E2E path) with the backend up. -
In a brand-new browser context, open
/log-inand runperformance.getEntriesByType('resource').filter((r) => r.name.endsWith('.js')). It lists 46 entries, whosetransferSizesums to about 2.1 MB. -
To replay everything above, use the kit in TALE-361's deliverable
tale-361-perf-evidence-bundle.tar.gz,occ-20261002T1915/scripts/:pg-up.sh,mkdb.mjs r5,backend-up.sh r5,preview-at.sh,seed-http.mjs r5;nav-bench.mjs r5 login-cold|dash-cold|dash-warm|dash-nav <n>, plusab.shandab-l.sh;entry-analyze.mjs <dist>for the composition, andsummarize-nav.pyandcontention2.pyfor the tables.
The bundle also holds the raw samples (JSONL), six Chrome traces (one per build and flow), the build logs and the host monitor.
Expected behavior
PERF-P10 holds with margin, and the signed-in landing is no slower for it. The acceptance budget below applies on this harness and host class. Each criterion is checked ABBA against the fix's base, n ≥ 10 per arm, with contention recorded.
- A cold
/log-intransfers ≤ 1.0 MB of JavaScript, with novendor-codemirror,vendor-katexor@xyflowcode. Its password field paints in ≤ 0.9 s median (base 1.19–1.27 s here; R reached 0.82 s). - A cold
/dashboard/{org}paints Send message no later than on the base (median).router-loadedstays within 150 ms ofmodule-load(base ~0.1 s; R ~0.9 s), so there is no second request wave on the critical path. - The first in-app visit of a route not yet loaded (All projects or Knowledge, with and without hover) stays within +50 ms of the base median (0.12–0.13 s).
- An English session loads one base catalog. A German or French session paints in its own language on the first frame, with no English flash. The language switcher still works, and the i18n parity suites pass.
scripts/check-entry-budget.tsfails the build above a gzip ceiling for the cold set, so it can't creep back, and thePERF-P10box records the new baseline and file count.
Related:
- Bug: old-bundle version skew breaks lazy routes after every demo deploy — no vite:preloadError handler, no recovery for removed-function calls #3089: more lazy chunks means more exposure to removed-chunk errors after a deploy.
- fix(platform): close the 2026-09-26 platform evaluation's S3 findings #3498: where the
PERF-P10baseline comes from.
Affected service
Platform
Version or commit
main eee0a1098f433c96fe2d3c9b83779f6eed32d6cc (2 Oct 2026). The experiments are this commit plus candidate-r.diff or candidate-l.diff, which were never pushed.
Browser and OS
- Chromium 141.0.7390.37, headless, 1440×900, DPR 1, service workers blocked (Playwright-core 1.58).
- Linux 7.0, a 4 vCPU VM in a cgroup of 2 CPUs and 4 GiB.
- Node 24.21.0, bun 1.4.2, PostgreSQL 16.14 + pgvector 0.8.6.
Relevant log output
main: Cold-load JS: 44 preloaded modules, 2064 KB gzip
still preloaded, should become lazy: assets/vendor-katex-C6eDj1IC.js
R: Cold-load JS: 65 preloaded modules, 877 KB gzip
L: Cold-load JS: 44 preloaded modules, 1839 KB gzip
still preloaded, should become lazy: assets/vendor-katex-C6eDj1IC.js
Before submitting
- I searched existing issues and this hasn't been reported yet. It is related to Bug: old-bundle version skew breaks lazy routes after every demo deploy — no vite:preloadError handler, no recovery for removed-function calls #3089, but neither that issue nor any other open issue covers the cold-load JS budget, route splitting or the locale catalogs.
Activity
yannickmonney commentedon Oct 3, 2026
Correction to the evidence, from the reporter's next performance occurrence (TALE-361).
The 2 Oct 19:15 stack behind this issue ran its backend with an empty
TALE_CONFIG_SYSTEM_DIR. A pre-created directory made the catalog copy skip itself, and the backend loggedPII data tree unavailable. So that stack had no built-in providers, models or harnesses catalog.What that does and doesn't change:
/log-in, theCold-load JSlines, the composition table);8b916c0b9, own Postgres and backend,vite preview, the same harness./dashboard/{org}→ Send message painted: 1,620 ms (1,488–1,825), n=10, against 1,755–1,976 ms in this issue's tables.8b916c0b9isCold-load JS: 44 preloaded modules, 2072 KB gzip.The acceptance budget is unchanged. Raw data is in the TALE-361 evidence bundle (
occ-20261003T0315/results/r6/dash-cold-catalog.jsonl).perf(ui): load KaTeX with the first streamed reply that holds math
perf(platform): load the metrics and automation canvas pages with the…
perf(platform): keep KaTeX, the flow canvas and list cores out of the…
perf(platform): load each page's code with its route
perf(platform): load German and French on first use
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
tale-code-bot commentedon Nov 1, 2026
Landed on Tale's feature line: feature train #5241 landed on
release/0.6by rebase at 2026-11-01T01:56:42Z, and this change is now commit 14b14f6 there (test(platform): fail a build whose cold load outgrows its gzip ceiling). It ships with Tale 0.6.0.GitHub closes issues by itself only for commits on
main, so the feature-train role closes this one as completed. Task: TALE-58.5 remaining items
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling
test(platform): fail a build whose cold load outgrows its gzip ceiling