LOAD-07License-check overhead

Pass

EnsureLicensed takes about 3.2 ns per call; even for the cheapest guarded operation (opening a 9 KB file in memory, about 5.0 us) that is under 0.1 %.

What this test proves

Shows that checking the license costs almost nothing compared with the work it guards.

How it was run

  1. With an Enterprise license active, LicenseManager.EnsureLicensed is called 50 million times per run, 15 runs, and the median time per call is taken.
  2. The same is measured for guarded operations: opening a small in-memory DICOM file, C-ECHO, C-STORE of a 128 KiB image, and connect + C-ECHO + release.

How correctness was checked

All guarded operations succeeded during measurement.

Measured results

Step Operations p50 Errors
DicomFile.OpenAsync(ReadOnlyMemory) of a 9128-byte CT 64x64 file
1 license check(s) per operation = 3.21 ns, 0.06425 % of the operation
300,000 0.01 ms 0
C-ECHO round trip on an open association (loopback)
0 license check(s) per operation = 0 ns, 0 % of the operation
75,000 0.1 ms 0
C-STORE of one MR 256x256 (128 KiB) on an open association, SCP parses it
2 license check(s) per operation = 6.41 ns, 0.00051 % of the operation
30,000 1.25 ms 0
connect + C-ECHO + release (new association each time)
2 license check(s) per operation = 6.41 ns, 0.00138 % of the operation
4,500 0.46 ms 0

Latency is per operation (p50 = median, p95/p99 = 95th/99th percentile). Memory is the peak working set of the test process.

License check cost

3.21 ns per check. EnsureLicensed takes about 3.2 ns per call; even for the cheapest guarded operation (opening a 9 KB file in memory, about 5.0 us) that is under 0.1 %.

Test run

Run
a20bedea-bacd-468b-af8d-945829c4b81f
Started (UTC)
2026-10-26 17:02:46, finished 2026-10-26 18:52:45
Test PC
Intel(R) Core(TM) i9-14900K, 24 cores / 32 threads, 64 GB RAM, NVMe SSD, Microsoft Windows 11 Pro build 26200.9711, .NET 10.0.12 (one PC, client and server on loopback)
License
Enterprise
Source commit
b804fb7
DicomKit
1.0.0 SHA-256 96ada39062c07bca37511abfb6baac0a44d914fb705bac01d77cb02146fdac0e
DicomKit.Imaging
1.0.0 SHA-256 015b51ea833039d934ba153cae50d393fb77846430ca3fc3d65b4fb8cf4346ed
DicomKit.Web
1.0.0 SHA-256 2a2f4f7f02e1849929294062bee7dd8f3a24449428469c1fddb6982e77218a7b
DicomKit.Web.AspNetCore
1.0.0 SHA-256 daa1105881f1c0b60ca9c788d52d41445bd653a9d190c8862a2b2b1386d5e37c