You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2015/11/05 22:56:27 UTC
[jira] [Comment Edited] (PDFBOX-3088) Cache glyph table to optimize
concurrent access
[ https://issues.apache.org/jira/browse/PDFBOX-3088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14992565#comment-14992565 ]
Tilman Hausherr edited comment on PDFBOX-3088 at 11/5/15 9:56 PM:
------------------------------------------------------------------
statistic of fonts with count of glyphs, number that are cached, and total hits (non uniqe) in the cache.
>From that, I have decided that fonts with > 5000 glyphs won't be cached (that'll keep PingFang & co. away). And if we cache, we don't cache more than 100 glyphs to avoid crazy memory usage.
was (Author: tilman):
statistic of fonts with count of glyphs, number that are cached, and total hits (non uniqe) in the cache.
>From that, I have decided that fonts with > 5000 glyphs won't be cached. And if we cache, we don't cache more than 100 glyphs to avoid crazy memory usage.
> 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
> Assignee: Tilman Hausherr
> Priority: Minor
> Labels: Optimization
> Fix For: 2.0.0
>
> Attachments: 0001-PDFBOX-3088-cache-glyph-table.patch, Benchmark.java, BenchmarkPDFBox3088.java, PDFBOX-3088.xlsx, 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-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org