Inconsistent pdf to docx conversion

Hi Team,
I am converting a PDF to DOCX using groupdocs conversion version 21.7.
Every time I am converting the PDF, I am getting different conversion time for the same document.
Its not very consistent.
image.png (20.3 KB)
I have attached a snip of my code, which I took it from demo project of groupdocs.
Is there any resource or converter instance which needs to be released/cleared after every conversion.
Can it handle concurrent calls?
Many Thanks

@manishanarula

We are investigating this scenario. Your investigation ticket ID is CONVERSIONJAVA-1704.

@Atir_Tahir

Since this is under investigation, is there any way to find out which page is currently taking time or is currently processing during the conversion of PDF to DOC.
We are currently converting the documents whose page number me warry from as low as 10 to as high as 2500+ pages and sometimes where the pdf has few images in between the conversion can take as long as 20-30 minuets.
Is there any property or wordProcessing option which we can set to get the processing information for the current converting document?

@manishanarula

There’s no such property or option. However, we are still investigating this ticket and will look into the possibility of adding such an option. You’ll be notified in case of any progress update.

@manishanarula

Yes, concurrency is supported.
Converter class has no functionality for per page performance measurement.
You can use something like this code for measurements:

        List<ByteArrayOutputStream> pageStreams = new ArrayList<>();
        Converter converter = new Converter("sample.pdf");
        final WordProcessingConvertOptions convertOptions = new WordProcessingConvertOptions();
        long[] times = new long[2];
        times[0] = new Date().getTime();
        converter.convert((SavePageStream) i -> {
            times[1] = new Date().getTime();
            System.out.printf("Page %d conversion time is %d ms.%n", i, times[1] - times[0]);
            times[0] = times[1];
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            pageStreams.add(byteArrayOutputStream);
            return byteArrayOutputStream;
        }, convertOptions);
        for (ByteArrayOutputStream pageStream : pageStreams) {
            pageStream.close();
        }