-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoding of lossless JPEG became slow #691
Comments
Hi Michael, I believe this is the same issue as #687, where the removal of the In the meantime, things will go faster if you use a different stream implementation (see my comment in the other issue) if that is possible for your use case. |
New stream support is out in the 3.9.0 release. Feel free to give it a try and report back! 😀 |
Hi Harald, |
Attaching failed, so i post the test results here: Tests from July 2022 (typical values): Bound with Twelvemonkeys version 3.8.2: Tests from Jan 11 2023, different machine, typical values: Bound with Twelvemonkeys version 3.9.4: |
Hello Harald, |
Hi Michael, As your test case involves far more than just TwelveMonkeys, it's a bit hard for me to see exactly what makes things slow in your case. The stream you pass to the DICOM plugin and how the DICOM plugin uses the JPEG plugin might affect these things. I have very limited spare time these days, so anything you can do to make it easier to pinpoint, will also help resolve this faster. I understand you want to upgrade to the latest version as soon a possible (I'm not sure I understand why 288 is relevant in this discussion). |
Describe the bug
When updating Twelvemonkeys imageio from version 3.4.1 to version 3.8.2, decoding of lossless JPEG slowed down by a factor of almost 10.
Version information
The version of the TwelveMonkeys ImageIO library in use.
3.8.2; performance used to be ok with 3.4.1
The exact output of
java --version
(orjava -version
for older Java releases).openjdk 11.0.14.1 2022-02-08 LTS
OpenJDK Runtime Environment Corretto-11.0.14.10.1 (build 11.0.14.1+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.14.10.1 (build 11.0.14.1+10-LTS, mixed mode)
Extra information about OS version, server version, standalone program or web application packaging, executable wrapper, etc. Please state exact version numbers where applicable.
OS: Microsoft Windows 10 Version 21H2 (Build 19044.1706)
To Reproduce
Steps to reproduce the behavior:
testReaderPerformance: ImageReader com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader needed 2587 milliseconds to read testfiles/jpegLossless.dcm
If compiled with Twelvemonkeys version 3.4.1, typical output times are like
testReaderPerformance: ImageReader com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader needed 318 milliseconds to read testfiles/jpegLossless.dcm
Expected behavior
Decode times like with Twelvemonkeys version 3.4.1, i.e. around 300 milliseconds for the attached sample file instead of about 2000 milliseconds
Example code --------------------------------------------------------------------------------------------------------------
{
package com.agfa.hap.ddc.util;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.awt.image.BufferedImage;
import java.io.File;
import java.lang.reflect.Field;
import java.util.Iterator;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.FileImageInputStream;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Logger;
import org.dcm4che3.imageio.plugins.dcm.DicomImageReader;
import org.junit.Test;
public class TestImageReaderPerformance {
}
}
End example code --------------------------------------------------------------------------------------------------------------
** DicomImageReader configuration file ImageReaderFactory64Bit.properties**
ImageReaderFactory64Bit.zip
Image sample file jpegLossy.dcm
jpegLossy.zip
The text was updated successfully, but these errors were encountered: