Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5286

Runtime degredation in RC1 and alpha2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.0.0 PDFBox
    • 3.0.0 PDFBox
    • Parsing
    • None

    Description

      working/reviewing PDFBOX-5068 and PDFBOX-5263 I've experiencing runtime issues for both 3.0.0-RC1 and 3.0.0-alpha2 when loading and saving a large PDF

      https://crossasia-books.ub.uni-heidelberg.de/xasia/reader/download/506/506-42-86246-2-10-20190822.pdf

      version runtime in millis
      2.0.24 2076
      3.0.0-RC1 219472
      3.0.0-alpha2 282284

      Basic test:

      long start = System.currentTimeMillis();
      PDDocument pdf = Loader.loadPDF(new File("506-42-86246-2-10-20190822.pdf"));
      pdf.save(new NullOutputStream());
      pdf.close();        
      long end = System.currentTimeMillis();      
      System.out.println("Elapsed Time in milliseconds: "+ (end-start));     
      

      with NullOuputStream

      package org.apache.pdfbox;
      
      import java.io.IOException;
      import java.io.OutputStream;
      
      public class NullOutputStream extends OutputStream {
      
          @Override
          public void write(byte[] b) throws IOException {
              // don't write anything
          }
      
          @Override
          public void write(byte[] b, int off, int len) throws IOException {
              // don't write anything
          }
      
          @Override
          public void write(int b) throws IOException {
              // don't write anything
          }
      }
      

      I've also running tests using JMH - they support these numbers. The difference in numbers for RC1/alpha2 are within a regular variation.

      Attachments

        1. flame-cpu-forward.html
          121 kB
          Maruan Sahyoun
        2. flame-cpu-reverse.html
          825 kB
          Maruan Sahyoun
        3. profiling.png
          384 kB
          Maruan Sahyoun

        Activity

          People

            lehmi Andreas Lehmkühler
            msahyoun Maruan Sahyoun
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: