jonathansp opened a new pull request, #196:
URL: https://github.com/apache/pdfbox/pull/196

   
[COSDictionary.MAP_THRESHOLD](https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java#L54)
 controls which Map class is used to optimize memory usage. By default, a 
SmallMap is used. However, if the number of items in a COSDictionary reaches 
the MAP_THRESHOLD value (hardcoded to 1,000), the references [are copied 
](https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java#L208)to
 a LinkedHashMap.
   
   For larger documents, where the COSDictionary is expected to be substantial 
bigger than this limit, this copying occurs frequently. Additionally, 
[SmallMap.keySet is not 
efficient](https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/SmallMap.java#L281).
 The attached screenshot shows pdfbox performance with SmallMap (in red) versus 
using LinkedHashMap, ignoring the threshold (in green).
   
   https://issues.apache.org/jira/browse/PDFBOX-5824


-- 
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