tballison commented on PR #533:
URL: https://github.com/apache/pdfbox/pull/533#issuecomment-5697905351

   Perf tests as reported by :robot: 
   ```
   ● Performance testing
   
     All runs on the same machine with two jars built from the same checkout: 
trunk before the patch (old) and after (new). Test files:
     G7BO7PNCCREVF2BCY5YSYOPYDLMBYASY (11.8 MB, 1,377,770 xref entries, 13,646 
object streams) and RFFQRH5P3P4YLUL5MWWZIPDQRKAPES2H
     (11.0 MB, 474,562 entries, 4,699 object streams).
   
     1. Reproduction. COSDocument.getObjectsByType(COSName.FILESPEC) after 
Loader.loadPDF: old did not finish in 600 s on either file
        (killed). jstack samples of tika-app -t on G7 all sit in 
BaseParser.getObjectKey → HashMap.putIfAbsent, called from
        PDFObjectStreamParser.parseAllObjects; 7 CPU-minutes in 90 s wall.
     2. After the patch. Same call: G7 3.7 s, RF 2.3 s. PDFTextStripper.getText 
unchanged (G7 1.2 s, RF 3.6 s) since plain text
        extraction only touches a few object streams.
     3. Load-time regression check. Loader.loadPDF + getNumberOfPages, best of 
15 iterations per JVM, 4 JVMs per jar, interleaved
        old/new, -XX:+UseParallelGC: G7 old 0.28–0.32 s vs new 0.22–0.33 s; RF 
old 0.19 s vs new 0.17 s. Parity. A first version of the
        patch was ~25% slower here because AbstractMap.putAll inserts one entry 
at a time and rehashes ~17 times on 1.38M entries;
        overriding putAll to bulk-insert into the presized HashMap and then 
index the keys removed that.
     4. Memory. Retained heap after load and System.gc(): identical old vs new 
(G7 261 MB, RF 104 MB). The previous per-parser cache
        was already built once in the top-level parser on the first 
getObjectKey call and lived as long as the document; the patch only
        removes the transient per-object-stream rebuilds (647 GCs / 18 s of 
pauses per 100 s in the original JFR).
     5. Differential correctness run (also a coarse perf check): 7,590 local 
PDFs, 5 parallel JVMs, 120 s per-file timeout, each pass
        ~2.5 min for both jars, no timeouts on either side.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to