[ 
https://issues.apache.org/jira/browse/PDFBOX-2882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632924#comment-14632924
 ] 

Timo Boehme commented on PDFBOX-2882:
-------------------------------------

The first check was only inserted as a short time workaround for the current 
test (PDFBOX-2883). It is needed because with the new load methods the 
ScratchFile is used for the streams but also for the input PDF provided as 
InputStream. Currently the scratch file and the input stream buffer are closed 
by {{PDDocument.close}} so close gets called twice and should not result in an 
exception. If the new funtionality is accepted the scratch file close handling 
will be changed and the first test can be removed.
Then the duplicate close check may be moved under the ioLock synchronization to 
get the same behaviour for scratch file and main-memory only usage. 

> Improve performance when using scratch file
> -------------------------------------------
>
>                 Key: PDFBOX-2882
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2882
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Parsing
>    Affects Versions: 2.0.0
>            Reporter: Timo Boehme
>            Assignee: Timo Boehme
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: ScratchFile.java, ScratchFileBuffer.java
>
>
> The current scratch file implementation uses many direct I/O calls which 
> slows down parsing compared with in-memory scratch buffer considerably.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to