Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3432

Optimize CID to GlyphId mapping (TTF)

    Details

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              michaeldoswald Michael Doswald
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: