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

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

I've reworked the synchronization in ScratchFile to hopefully have it now to a 
minimum. There is a single ioLock which is used for all tasks involving the 
scratch file. The other lock used is on freePages. This differentiation allows 
to get a new page/release pages which there are parallel read/write operations. 
The isClosed is now only a volatile boolean (was AtomicBoolean) so that 
accessing it is even much cheaper. For read/write of in-memory pages no 
synchronization is done (only 'write' needs to read volatile isClosed after 
writing for handling corner case of a parallel close operation.

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