Skip to content

Normal volume projection benchmark ​

Local CPU measurements for projectVolume, recorded 2026-10-08. These are synthetic Node timings, not browser frame rates or a comparison against the previous renderer.

  • Hardware/runtime: Apple M3 Max, darwin arm64, Node v26.7.0.
  • Workload: 256 × 256 × 256 Float32 volume (64 MiB), Fibonacci sphere of radius 80 mm, depths [-2, 2] mm, mean reduction, all samples valid, no mask.
  • Each case: 2 warm-up calls, then 7 timed calls. Input construction and correctness checks are excluded; input validation, affine inversion and output allocations are included.
  • The table reports median ± median absolute deviation in milliseconds. It is a local snapshot; system load and vertex ordering affect the results.
  • The 164k-to-324k linear timings are noisy and consistent with cache-sensitive performance; these measurements do not establish linear time scaling. The archived bundle hash identifies the measured implementation, before later viewer fixes and legacy sampler caching.
  • Correctness: every output is finite with the expected sample count; selected vertices are compared with an independent analytic field calculation. Unit tests separately cover nonlinear fields, masks, missing data and oblique transforms.
  • Output arrays use 8 bytes per vertex (Float32 values and Uint32 counts). The volume buffer is borrowed.
VerticesSamplesNearest (ms)Linear (ms)
32,492514.5 ± 2.221.7 ± 2.5
32,4921626.9 ± 1.152.5 ± 3.7
163,842558.5 ± 9.385.6 ± 2.9
163,84216109.6 ± 6.2263.0 ± 33.5
324,002594.0 ± 3.1264.4 ± 42.9
324,00216325.9 ± 75.7508.2 ± 4.2

Larger cases take hundreds of milliseconds synchronously. Project once and reuse the scalar values for display changes; applications needing uninterrupted interaction during repeated projection can run the function in a worker.

Reproduce ​

sh
npm run build
node scripts/benchmark-volume-projection.mjs --output=/tmp/volume-projection.json

The repository retains full measurements, variability and the exact built ESM SHA-256 in benchmarks/volume-projection.json. No timing threshold is imposed on CI.

API contract and example

Released under the MIT License.