Skip to content

Performance Benchmark

Generated on 2026-06-11 from local CPU/GPU timing runs.

This report publishes a lightweight performance baseline for the code paths that developers exercise most often: material lookup, PixelStack geometry generation, TMM sweeps, and low-order torcwa RCWA sweeps.

Executive summary

  • All-material 41-wavelength lookup median: 19.7626 ms.
  • PixelStack construction median: 102.5448 ms for 2x2, 105.3031 ms for 4x4.
  • TMM 31-wavelength sweep median: 0.019 s; fitted cost 0.5786 ms/wavelength.
  • torcwa CPU 5-wavelength low-order sweep median: 2.8404 s; fitted cost 604.8363 ms/wavelength.
  • CUDA was not available in this environment, so GPU rows are recorded as not available.

Scope

These are local timing numbers, not universal performance guarantees. The RCWA case is a low-order smoke benchmark, and traced memory excludes some native library allocations such as PyTorch/CUDA allocator internals.

Environment

FieldValue
PlatformWindows-11-10.0.26200-SP0
Python3.12.12
MachineAMD64
ProcessorIntel64 Family 6 Model 151 Stepping 5, GenuineIntel
CPU count12
Torch2.11.0+cpu
CUDA availableno
CUDA devices0
CUDA device namen/a
torcwa availableyes
torcwa version0.1.4.2

Core CPU Operations

Core operation runtime

CategoryBenchmarkSizeRepeatsMedian msMin msMax msPeak MB
materialSilicon epsilon spectrum lookupsilicon x 41 wl50.51140.37460.63810.0022
materialAll-material spectrum lookup43 materials x 41 wl519.762618.764225.92810.0036
constructionPixelStack construction2x2 Bayer5102.544888.6468119.93510.188
constructionPixelStack construction4x4 TetraCell5105.303199.3698119.52640.1883
layer_slicesget_layer_slices32x32, 8 lens slices54.20252.72815.00910.4285
layer_slicesget_layer_slices64x64, 8 lens slices54.6463.33896.57381.6473
layer_slicesget_layer_slices128x128, 8 lens slices56.39955.376114.79346.5223
layer_slicesget_layer_slices192x192, 8 lens slices514.933813.858716.356414.6473
permittivity_gridget_permittivity_grid32x32x6448.25137.39689.7461.7842
permittivity_gridget_permittivity_grid64x64x6449.92169.711910.87557.0342
permittivity_gridget_permittivity_grid96x96x64415.807213.761916.970915.7842
permittivity_gridget_permittivity_grid128x128x64427.159323.09629.896228.0342

Geometry Scaling

Geometry scaling

Memory profile

Solver Sweep Cost

Solver wavelength scaling

SolverDeviceWavelengthsStatusRepeatsMedian sms / wlwl / smax energy residualtraced MBGPU MB
tmmcpu1ok30.00111.0969911.660300.0107n/a
tmmcpu11ok30.00770.69981428.97971.11e-160.0118n/a
tmmcpu31ok30.0190.61371629.36641.11e-160.0131n/a
tmmcpu61ok30.03210.52681898.28911.11e-160.0152n/a
tmmcpu101ok30.06070.60081664.42821.11e-160.0196n/a
torcwacpu1ok30.6147614.70731.626801.538n/a
torcwacpu3ok31.7693589.75221.695602.8789n/a
torcwacpu5ok32.8404568.08261.760302.8898n/a
torcwacpu9ok35.4565606.28211.649402.9098n/a
torcwacudan/anot_available0n/an/an/an/an/an/a

Interpretation

  • TMM remains the fast path for stack screening and wavelength-dense BARL sweeps.
  • Low-order torcwa CPU runtime scales close to linearly with wavelength count, so larger reports should budget by wavelength first, then Fourier order.
  • Geometry generation is cheap enough for repeated report generation at the tested resolutions, but 3D permittivity grids dominate traced memory.
  • The GPU row is intentionally conditional; machines without CUDA still generate a complete CPU report.

Regeneration

powershell
uv run python scripts\generate_performance_benchmark_report.py

Generated metrics are stored at docs/public/reports/performance-benchmark/performance_benchmark_metrics.json.