This has been one of the biggest improvements and cumulative optimization changes to our DICOM toolkit since the beginning. We are proud to announce the performance enhancements starting from build 8.XX.200. These changes will be included only in the Development builds only (until the next LTS version is released). Pre-released LTS versions won’t get this update because of breaking changes and API updates which wouldn’t be sensible to be added this late.
We have done some extensive benchmarking comparison of our release versions and the build after these optimization changes. To give you a summary of the performance changes we have included some results below.
In our tests, we are comparing DicomObjects load times and memory usage. We are using BenchmarkDotNet Nuget package for all our tests. A small but very important difference between DicomDataSet and DicomImage is that the pixel data and display related properties are not loaded immediately, (lazy loading/on-demand loading is the default behaviour, when using DicomDataSet as opposed to DicomImage which loads everything in advance, especially if the input source is not a FileStream (passed as a string ‘Filename’).
Starting with a simple read comparison, this result below shows different ways of reading in the data (namely Filename, Byte array or Stream object) and the input data is a collection of single-frame and multi-frame images.
|Optimized vs Pre-optimization Read only Execution time|
|Optimized vs Pre-optimization Read only Memory usage|
A more comprehensive test would be to read the data, transcode it into another TransferSyntax and then write it out to disk and we are glad to say that is showing massive improvements too:
|Optimized vs Pre-optimization Read-Write Execution time|
|Optimized vs Pre-optimization Read-Write Memory usage|
We also tested these optimization changes against another third-party DICOM library available on Nuget to see how they compare:
|Optimized vs Third-party Read-Write Execution time|
|Optimized vs Third-party Read-Write Memory usage|
Taking this new changes, we did additional compression stress tests by reading and writing 1000s of images several times to calculate the time taken and compression ratio for different compressed TransferSyntaxes:
|Optimized vs Pre-optimization compression test|
We strive to keep improving and enhancing our toolkit for our users to get the best out of our library and utilize the latest framework improvements. Please feel free to try out the latest Development build - .NET Dev