diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b35fc3..2e72319 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,6 +93,7 @@ system dependencies with `npx playwright install --with-deps chromium firefox` a window (for example `PERF_LADDER=25000,200000` measures synthetic models made by `tools/SyntheticModel`); its settings are described at the top of `test/perf/orbit.perf.js`. Set `PERF_STARTUP_ONLY=1` to [measure the first frame](docs/startup-performance.md). +For repeatable GPU comparisons, use the [reference workloads and measurements](docs/viewer-performance-baseline.md). The harness runs outside CI. Include its numbers in the pull request when a change can affect rendering speed. npm dependencies are pinned to exact versions. When updating three.js (for example a Dependabot pull diff --git a/docs/startup-performance.md b/docs/startup-performance.md index 7406663..902886c 100644 --- a/docs/startup-performance.md +++ b/docs/startup-performance.md @@ -14,6 +14,8 @@ HTML parsing and browser startup work. On browsers with Long Tasks reporting, bl 50 ms for each reported task before `ready`. The heap figure is the largest JavaScript heap sample at the phase boundaries. Brief allocations between samples and GPU memory are outside that measurement. +See the [viewer GPU baseline](viewer-performance-baseline.md) for the full orbit and picking measurements. + ## Reference workloads - Generate the deterministic 200,000-element fixture with `PERF_LADDER=200000`. It has 200,000 instances and diff --git a/docs/toc.yml b/docs/toc.yml index 3325344..17800fc 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -7,6 +7,8 @@ href: public-api.md - name: Viewer startup performance href: startup-performance.md + - name: Viewer GPU performance baseline + href: viewer-performance-baseline.md - name: API reference href: api/ - name: GitHub diff --git a/docs/viewer-performance-baseline.md b/docs/viewer-performance-baseline.md new file mode 100644 index 0000000..90f50e6 --- /dev/null +++ b/docs/viewer-performance-baseline.md @@ -0,0 +1,99 @@ +--- +title: Viewer GPU performance baseline +--- + +# Viewer GPU performance baseline + +This reference covers adaptive and full-detail orbit, first frame, picking and memory for the viewer at +`85d57b023947cd1c1cd307ed89b288cf039af1f9`. The viewport was 1920×1080 at device pixel ratio 1. +Headed Chromium 158.0.8127.18 ran in ANGLE D3D11 with display pacing enabled on a 60 Hz desktop. +The host ran Windows 11 build 26300 with a Ryzen 9 9900X3D, Node.js 24.11.1 and .NET SDK 10.0.401. + +| GPU mode | Renderer | Windows driver | +| --- | --- | --- | +| `integrated` | AMD Radeon Graphics, device `0x13c0` | 32.0.21030.31 | +| `default` | NVIDIA GeForce RTX 4080, device `0x2704` | 32.0.16.2124 | + +## Reproduce the workloads + +From the repository root, build the bundle at the revision you want to measure, then export the two fixtures. +The synthetic pipe network uses the generator's fixed seed and default geometry reuse. The IFC is the +Schependomlaan design model. [Pinned IFC source](https://github.com/openBIMstandards/Archive-DataSetSchependomlaan/blob/e6971d897b60f04ea28b4e3f2acf80d05f269197/Design%20model%20IFC/IFC%20Schependomlaan.ifc) + +```powershell +$bench = Join-Path ([IO.Path]::GetTempPath()) 'ioviewer-reference' +New-Item -ItemType Directory -Force -Path $bench | Out-Null +$ifc = Join-Path $bench 'Schependomlaan.ifc' +$source = 'https://raw.githubusercontent.com/openBIMstandards/Archive-DataSetSchependomlaan/e6971d897b60f04ea28b4e3f2acf80d05f269197/Design%20model%20IFC/IFC%20Schependomlaan.ifc' +Invoke-WebRequest -Uri $source -OutFile $ifc +if ((Get-FileHash -LiteralPath $ifc -Algorithm SHA256).Hash -ne '2C3565CA1904F2AA61ADAB92024CF3755B2C5B21A498144D3094D7CB58CEBEC7') { + throw 'Unexpected Schependomlaan IFC checksum' +} + +npm --prefix src/IOViewer/Viewer ci +npm --prefix src/IOViewer/Viewer run build +dotnet run tools/SyntheticModel/SyntheticModel.cs -c Release -- --elements 400000 --out (Join-Path $bench 'Synthetic-400k.html') +dotnet run --project src/IOViewer.Cli -c Release -f net10.0 -- $ifc -o (Join-Path $bench 'Schependomlaan.html') +``` + +The SHA-256 values below are for the bytes decoded from each HTML page's BIN block. The synthetic hash matched on +two independent exports. + +| Workload | Decoded BIN SHA-256 | +| --- | --- | +| Synthetic-400k | `c888a94c8ffa2c6972dff7966bf335c177e399174a7e0553ea420917b5841546` | +| Schependomlaan | `014cbfe49ee7164bdd2115155f04a22d0c4f0abaeec819689288c249d85bacf7` | + +### Run the benchmark + +Run from the viewer directory. Leave CPU profiling, uncapped rendering and startup-only mode disabled for this +comparison. Keep the browser visible, run one benchmark at a time and check the `renderer` in every report. +Chromium's low-power preference selects the integrated GPU on the reference host. + +```powershell +Set-Location src/IOViewer/Viewer +npx playwright install chromium +$env:PERF_MODELS = (Join-Path $bench 'Synthetic-400k.html') + ',' + (Join-Path $bench 'Schependomlaan.html') +$env:PERF_OUT = Join-Path $bench 'reports' +Remove-Item Env:PERF_PROFILE, Env:PERF_STARTUP_ONLY, Env:PERF_UNCAPPED, Env:PERF_LADDER, Env:PERF_VARIANTS -ErrorAction SilentlyContinue +for ($trial = 1; $trial -le 3; $trial++) { + $order = if ($trial % 2 -eq 1) { @('default', 'integrated') } else { @('integrated', 'default') } + foreach ($gpu in $order) { + $env:PERF_GPU = $gpu + $env:PERF_LABEL = "$gpu-$trial" + npm run perf + if ($LASTEXITCODE -ne 0) { throw "Benchmark failed for $env:PERF_LABEL" } + } +} +``` + +Each `ladder-