test(tests): R4.2e browser measurements of the Rust import (module worker page, same perimeter as the TS baseline)
r4-import.mjs runs the 226 baseline files and the hostile classes through a disposable module worker calling SheetHandle.import_pdf in Chromium 156, Firefox 157 and WebKit 27.2 under the RSS watchdog (not a guaranteed limit); compare-imports.mjs prints TS vs Rust; serve.mjs gains opt-in mounts (/r4/, /pkg/). Results 2026-10-18-r4-import.json: 666/678 agreements, the 12 others are the 4 declared files; W4 met (max 68 MiB linear); the 1 GiB ceiling traps in every engine.
This commit is contained in:
1 parent
cad485b13c
commit
c84186b032
14 files changed
+3135
-17
No files matched your search
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* A results file as text: indented, except that each run of a `runs`
|
||||
* array sits on one line, so a full R4 run (about 700 runs) stays under
|
||||
* 1 MB and still diffs run by run.
|
||||
*/
|
||||
export function resultsJson(result) {
|
||||
const runLists = []
|
||||
const text = JSON.stringify(
|
||||
result,
|
||||
(key, value) => {
|
||||
if (key !== 'runs' || !Array.isArray(value)) return value
|
||||
runLists.push(value.map((run) => JSON.stringify(run)))
|
||||
return `@@runs:${runLists.length - 1}@@`
|
||||
},
|
||||
1,
|
||||
)
|
||||
return text.replace(/"@@runs:(\d+)@@"/g, (_, i) => {
|
||||
const runs = runLists[Number(i)]
|
||||
return runs.length ? `[\n${runs.join(',\n')}\n]` : '[]'
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user