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

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

With rev. 1705659 I've moved the isClosed check under ioLock synchronization. 
Thus there is no race condition anymore. The {{if(isClosed)}} in {{close()}} 
could be removed but won't have any noticeable effect beside that the rare case 
of not being able to remove the existing temporary file would again be reported 
via an IOException. Thus I left the test there to shorten the time of a 
repeated {{close()}} call.
As already pointed out above the {{checkClosed()}} is needed to get the same 
behaviour independent if the ScratchFile is main memory only, temporary file 
only or in mixed mode.
If there is no objection I will set this issue to resolved.

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