Skip to content

Benchmarks

Jennings Zhang edited this page Jul 17, 2023 · 5 revisions

Benchmarking the performance of

  • one px-repack process per DICOM file
  • one px-repack process for the entire series (batch mode)

Summary

The performance improvements vary wildly, depending on the amount of data and also machine specs. Nonetheless, it's always dramatically more efficient to call px-repack one per series instead of once per instances. You can expect gains of

  • 5 times faster
  • 57 times less CPU time
  • 2.4 times less memory usage

Hyperfine Command

hyperfine --runs 3 --prepare 'rm -rf /tmp/dicom' \
'fd --type f --exec px-repack --xcrdir {//} --xcrfile {/} --verbosity 0 --logdir /tmp/dicom/log --datadir /tmp/dicom/data \; . data' \
'px-repack --xcrdir data --parseAllFilesWithSubStr , --verbosity 0 --logdir /tmp/dicom/log --datadir /tmp/dicom/data'

Hyperfine Results

Benchmark 1: fd --type f --exec px-repack --xcrdir {//} --xcrfile {/} --verbosity 0 --logdir /tmp/dicom/log --datadir /tmp/dicom/data \; . data
  Time (mean ± σ):     11.221 s ±  0.103 s    [User: 137.516 s, System: 64.497 s]
  Range (min … max):   11.123 s … 11.328 s    3 runs

Benchmark 2: px-repack --xcrdir data --parseAllFilesWithSubStr , --verbosity 0 --logdir /tmp/dicom/log --datadir /tmp/dicom/data
  Time (mean ± σ):      2.237 s ±  0.018 s    [User: 2.289 s, System: 1.268 s]
  Range (min … max):    2.221 s …  2.256 s    3 runs

Summary
  px-repack --xcrdir data --parseAllFilesWithSubStr , --verbosity 0 --logdir /tmp/dicom/log --datadir /tmp/dicom/data ran
    5.02 ± 0.06 times faster than fd --type f --exec px-repack --xcrdir {//} --xcrfile {/} --verbosity 0 --logdir /tmp/dicom/log --datadir /tmp/dicom/data \; . data

Resource usage

        Command being timed: "fd --type f --exec px-repack --xcrdir {//} --xcrfile {/} --verbosity 0 --logdir /tmp/dicom/log --datadir /tmp/dicom/data ; . data"
        User time (seconds): 139.24
        System time (seconds): 66.47
        Percent of CPU this job got: 1821%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:11.29
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 203760
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 338
        Minor (reclaiming a frame) page faults: 2793168
        Voluntary context switches: 7359
        Involuntary context switches: 63459174
        Swaps: 0
        File system inputs: 0
        File system outputs: 1584
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0

        Command being timed: "px-repack --xcrdir data --parseAllFilesWithSubStr , --verbosity 0 --logdir /tmp/dicom/log --datadir /tmp/dicom/data"
        User time (seconds): 2.39
        System time (seconds): 1.20
        Percent of CPU this job got: 158%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:02.28
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 85236
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 17561
        Voluntary context switches: 29
        Involuntary context switches: 99047
        Swaps: 0
        File system inputs: 0
        File system outputs: 72
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0
Clone this wiki locally