Compare commits

...

1 Commits

Author SHA1 Message Date
cesnimda 4eb8a2933b docs(perf): preserve source-bound static encoding measurements 2026-11-18 01:23:47 +01:00
8 changed files with 1415 additions and 0 deletions
@@ -0,0 +1,21 @@
# PERF-BASE / PERF-12 static encoding measurement
Recorded 17 November, preserved and qualified 18 November 2026. Frozen source `eb2538772e1bfabbeb291e4a5efa177c79074de1`, Node24.19.0 Windows, Next16.4.6 static export, explicit API5302 build. This is an offline content-size/encoding baseline, not an application optimisation, current later-source export, deployed compression test or production readiness. The previous performance baseline used a different application source and is not a controlled before/after comparison.
| Frozen export group | Files | Raw bytes | Gzip6 bytes | Brotli5 bytes |
| --- | ---: | ---: | ---: | ---: |
| JavaScript | 58 | 3,674,509 | 1,089,362 | 1,015,470 |
| CSS | 2 | 3,958 | 1,189 | 1,073 |
| SVG | 4 | 28,397 | 6,971 | 6,404 |
| HTML | 3 | 32,504 | 8,339 | 7,486 |
| Root-declared scripts, deduplicated, including legacy | 7 | 582,094 | 178,820 | 169,211 |
All67 text assets were compressed three times in memory and decompressed with exact byte equality:402 roundtrip assertions passed. Native JSON retains each raw SHA256, encoded sizes and all three elapsed-time samples. Root-declared scripts exclude later dynamic imports; complete export inventory is not a route/network request budget. No source maps were emitted by this frozen build. Headers, TLS, cache state, transfer and on-device decompression are not measured.
The summed per-file median encoding costs were approximately84.9ms gzip6 and180.6ms Brotli5 on this warm-file Windows host. They are exploratory local CPU observations, not a batch-time median or server capacity result. Other development/browser work was active; there was no controlled idle-host/load experiment. These timings justify no production throughput/latency or cost claim. Encoded content sizes are deterministic for the recorded inputs/runtime; no live delivery savings are claimed.
The local desktop-linux Docker endpoint was confirmed to be the local Windows named pipe; a read-only version probe failed because that pipe was absent. No daemon/infrastructure repair, container/image operation or repeated unchanged failure was attempted. Runtime Nginx/static encoding, Accept-Encoding/Vary/cache and private-response boundaries remain unqualified. No gzip/Brotli configuration, CDN, topology, image, API middleware, dependency, file deletion or production change was made.
Next eligible runtime experiment requires an available authorised disposable Nginx/container lane. Compare public immutable assets first; retain HTML revalidation and private API/document isolation, one encoding layer, correct MIME/cache/Vary behavior and exact decode integrity. Brotli module presence and target CPU/storage cost must be proven rather than assumed. Keep PERF-12 PARTIAL and deployed configuration unchanged until that evidence exists. PERF-04 requested-icon and PERF-09 route-chunk concerns retain their own measurements and gates; this census does not qualify either.
[Source, producer and native receipts](evidence/SOURCE_RECEIPTS.json) preserve the exact frozen manifest and assert-bearing Node script without adding a runtime/CI runner. No new backend/MariaDB/browser/provider/model/hosted/native-device or production qualification.
@@ -0,0 +1,33 @@
{
"sourceCommit": "eb2538772e1bfabbeb291e4a5efa177c79074de1",
"sourceGitBlobSha256": {
"job-tracker-ui/package.json": "8b31e44c10b77b6d1e007af04c757c0577f12972ff3f6c7079bbc4c446a0d415",
"job-tracker-ui/package-lock.json": "ac90fbdc79e2e0f23d54748814b41a03f5dcaf8fd27291b3dcb73b2603a83e72",
"job-tracker-ui/next.config.js": "2bbcc9d6093d6f263114f4992fd9c77a6172f0602deb92bf7163823ba58b1757",
"job-tracker-ui/app/layout.tsx": "d2e460998e4182f11657089850f9144059f453ebd9c4d1fbcd3f6aee25449843"
},
"nativeReceipts": [
{
"path": "measure-static-encoding.mjs.txt",
"canonicalSha256": "b700120c790f4ec50f125ade040b82044ccbc79a5d0142885d7a34910762b682",
"rawSha256": "b700120c790f4ec50f125ade040b82044ccbc79a5d0142885d7a34910762b682",
"gzipSha256": "020bb4bc3445a426f8757b9268b8b3b62e1ddbc8d8961d8a35c511840c7cb7d5",
"nativeEncoding": "utf-8-sig"
},
{
"path": "static-encoding.json",
"canonicalSha256": "a5ba46dcad650f8de1bbadcb5f77331ed3f40fc05058f5c79d347471b654a25b",
"rawSha256": "a5ba46dcad650f8de1bbadcb5f77331ed3f40fc05058f5c79d347471b654a25b",
"gzipSha256": "941f8e1bb95196a1c3dd2341623a2f4fd7a79460395afab34562aba14712bcd9",
"nativeEncoding": "utf-8-sig"
},
{
"path": "static-encoding.txt",
"canonicalSha256": "8ae1d675b5874c82ddf4cc0e4a4e7351822f293953ec8338034d3cc3736fefa1",
"rawSha256": "1171e4f98ed0c9eac50f6b1f71c6f643e6e324c4c29aba6ac868e7d7a3717ccd",
"gzipSha256": "5efc6aaf111bfec3478589d5d6d5ced531623a40d41c07408f233b9be84053b7",
"nativeEncoding": "utf-16"
}
],
"scope": "Frozen offline export census/encoding only, not current runtime or deployed transfer"
}
@@ -0,0 +1,34 @@
import fs from 'node:fs';
import path from 'node:path';
import crypto from 'node:crypto';
import os from 'node:os';
import assert from 'node:assert/strict';
import { performance } from 'node:perf_hooks';
import { gzipSync, gunzipSync, brotliCompressSync, brotliDecompressSync, constants } from 'node:zlib';
const [exportPath, output] = process.argv.slice(2);
const root = path.resolve(exportPath);
const sha = bytes => crypto.createHash('sha256').update(bytes).digest('hex');
function walk(dir) { return fs.readdirSync(dir, { withFileTypes: true }).flatMap(e => e.isDirectory() ? walk(path.join(dir, e.name)) : [path.join(dir, e.name)]); }
const entries = walk(root).filter(name => /\.(?:js|css|html|svg)$/.test(name)).sort();
assert.ok(entries.length > 0);
const median = values => [...values].sort((a,b)=>a-b)[Math.floor(values.length/2)];
const files = entries.map(name => {
const raw = fs.readFileSync(name), relative = path.relative(root, name).replaceAll('\\', '/');
const gzipTimes = [], brotliTimes = [];
let gzip, brotli;
for (let repetition=0; repetition<3; repetition++) {
let start = performance.now(); gzip = gzipSync(raw, { level: 6 }); gzipTimes.push(performance.now()-start);
start = performance.now(); brotli = brotliCompressSync(raw, { params: { [constants.BROTLI_PARAM_QUALITY]: 5 } }); brotliTimes.push(performance.now()-start);
assert.deepEqual(gunzipSync(gzip), raw); assert.deepEqual(brotliDecompressSync(brotli), raw);
}
return { path: relative, sha256: sha(raw), rawBytes: raw.length, gzip6Bytes: gzip.length, brotli5Bytes: brotli.length, gzipMilliseconds: gzipTimes, brotliMilliseconds: brotliTimes, gzipMedianMilliseconds: median(gzipTimes), brotliMedianMilliseconds: median(brotliTimes) };
});
const sum = group => ({ files: group.length, rawBytes: group.reduce((n,x)=>n+x.rawBytes,0), gzip6Bytes: group.reduce((n,x)=>n+x.gzip6Bytes,0), brotli5Bytes: group.reduce((n,x)=>n+x.brotli5Bytes,0) });
const html = fs.readFileSync(path.join(root, 'index.html'), 'utf8');
const scriptPaths = [...new Set([...html.matchAll(/<script\b[^>]*\bsrc="([^"]+)"[^>]*>/g)].map(m=>m[1].split('?')[0].replace(/^\//,'')))];
assert.ok(scriptPaths.length > 0);
const indexScripts = files.filter(f=>scriptPaths.includes(f.path));
assert.equal(indexScripts.length, scriptPaths.length);
const report = { source: 'eb2538772e1bfabbeb291e4a5efa177c79074de1', environment: { node: process.version, platform: process.platform, architecture: process.arch, cpu: os.cpus()[0].model }, buildApiBase: 'http://localhost:5302/api', indexSha256: sha(Buffer.from(html)), repetitions: 3, summaries: { javascript: sum(files.filter(x=>x.path.endsWith('.js'))), css: sum(files.filter(x=>x.path.endsWith('.css'))), svg: sum(files.filter(x=>x.path.endsWith('.svg'))), html: sum(files.filter(x=>x.path.endsWith('.html'))), declaredIndexScripts: sum(indexScripts) }, sourceMaps: walk(root).filter(name=>name.endsWith('.map')).length, files, limits: ['Offline warm-file compression cost and content sizes only; excludes HTTP headers/TLS/network', 'No nginx/CDN/API compression configuration or production change', 'Complete export inventory is not a route request budget; root declared scripts exclude later dynamic imports', 'Three local repeats do not establish field latency, server throughput or deployed encoding'] };
fs.writeFileSync(output, JSON.stringify(report, null, 2)+'\n');
console.log(JSON.stringify({ summaries: report.summaries, sourceMaps: report.sourceMaps, verifiedRoundTrips: files.length * 3 * 2 }));
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
{"summaries":{"javascript":{"files":58,"rawBytes":3674509,"gzip6Bytes":1089362,"brotli5Bytes":1015470},"css":{"files":2,"rawBytes":3958,"gzip6Bytes":1189,"brotli5Bytes":1073},"svg":{"files":4,"rawBytes":28397,"gzip6Bytes":6971,"brotli5Bytes":6404},"html":{"files":3,"rawBytes":32504,"gzip6Bytes":8339,"brotli5Bytes":7486},"declaredIndexScripts":{"files":7,"rawBytes":582094,"gzip6Bytes":178820,"brotli5Bytes":169211}},"sourceMaps":0,"verifiedRoundTrips":402}