[ 
https://issues.apache.org/jira/browse/PDFBOX-3088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ccouturi updated PDFBOX-3088:
-----------------------------
    Description: 
If several threads convert several pdf to png (one thread access to a single 
document at a time) they are a contention on a lock in GlythTable. Jstack shows 
that all threads are in state blocked on the synchronized block  in the 
getGlyph method. The lock is necessary, it's ok, but degrades performance.

This patch cache glyphs already read. 
With the patch PDFBOX-3080, the follow benchmark compare 1000 pdf conversions 
with 1, 8, and 50 threads.

|| Simulation|| PDF 2.0-SNAPSHOT || With this patch + PDFBOX3080 ||
|| 1000 conversions / 1 thread | 120 s | 71 s|
|| 1000 conversions / 8 threads | 76 s | 28 s|
|| 1000 conversions / 50 threads | 81 s | 33 s|

  was:
If several threads convert several pdf to png (one thread access to a single 
document at a time) they are a contention on a lock in GlythTable. Jstack shows 
that all threads are in state blocked on the synchronized block  in the 
getGlyph method. The lock is necessary it's ok, but degrades performance.

This patch cache glyphs already read. 
With the patch PDFBOX-3080, the follow benchmark compare 1000 pdf conversions 
with 1, 8, and 50 threads.

|| Simulation|| PDF 2.0-SNAPSHOT || With this patch + PDFBOX3080 ||
|| 1000 conversions / 1 thread || 120 s | 71 s|
|| 1000 conversions / 8 threads || 76 s | 28 s|
|| 1000 conversions / 50 threads || 81 s | 33 s|


> Cache glyph table to optimize concurrent access
> -----------------------------------------------
>
>                 Key: PDFBOX-3088
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3088
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: FontBox
>    Affects Versions: 2.0.0
>            Reporter: ccouturi
>            Priority: Minor
>         Attachments: Benchmark.java, patch_cache_glyphs, test_medium.pdf
>
>
> If several threads convert several pdf to png (one thread access to a single 
> document at a time) they are a contention on a lock in GlythTable. Jstack 
> shows that all threads are in state blocked on the synchronized block  in the 
> getGlyph method. The lock is necessary, it's ok, but degrades performance.
> This patch cache glyphs already read. 
> With the patch PDFBOX-3080, the follow benchmark compare 1000 pdf conversions 
> with 1, 8, and 50 threads.
> || Simulation|| PDF 2.0-SNAPSHOT || With this patch + PDFBOX3080 ||
> || 1000 conversions / 1 thread | 120 s | 71 s|
> || 1000 conversions / 8 threads | 76 s | 28 s|
> || 1000 conversions / 50 threads | 81 s | 33 s|



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to