You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Michael Doswald (JIRA)" <ji...@apache.org> on 2016/07/21 08:47:20 UTC

[jira] [Created] (PDFBOX-3432) Optimize CID to GlyphId mapping (TTF)

Michael Doswald created PDFBOX-3432:
---------------------------------------

             Summary: Optimize CID to GlyphId mapping (TTF)
                 Key: PDFBOX-3432
                 URL: https://issues.apache.org/jira/browse/PDFBOX-3432
             Project: PDFBox
          Issue Type: Improvement
          Components: FontBox
    Affects Versions: 2.0.2
         Environment: Ubuntu 14.04.4 LTS
            Reporter: Michael Doswald
            Priority: Trivial


TTF fonts map code-points (Code IDs) to glyphs. These are mappings from int to int. Because the JDK lacks map classes for primitive types, the code (e.g. in CmapSubtable) currently uses Map<Integer,Integer> for those mappings. This is inefficient in different ways:

* Autoboxing/unboxing introduces a performance penalty
* Boxing to Integer objects has a memory overhead
* The JDK Map implementation has a big memory overhead for such simple objects

For efficiency (execution time and memory consumption) I would propose to introduce a simple IntIntMap implementation which works with primitive integers.








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