Tags: gradienthealth/dicom
Tags
Implement buffered reading [10x speed increase] (#33) After using `pprof` to run CPU profiles of the existing code (which I thought seemed slower than it should be), I noticed a lot of CPU time was going to syscalls. Given the file reading task that this code was performing this did not make sense (likey something I/O heavy going on here). After auditing the code I realized that the default readers in this codebase were unbuffered. Changing to buffered readers led to a 10x speed boost when reading a Native PixelData dicom from disk: Before: ``` ./build/dicomutil --extract-images-stream 13.86s user 9.69s system 106% cpu 22.204 total ``` After: ``` ./build/dicomutil --extract-images-stream 2.91s user 0.38s system 159% cpu 2.061 total ```