Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-3206

[PATCH] Fonts: allow skipping the last modified check

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.9
    • None
    • font/unqualified
    • None
    • Patch

    Description

      While profiling PDF generation performance, we noticed that a significant amount of time is spent checking the last modified date of the font files here:
          
      https://github.com/apache/xmlgraphics-fop/blob/main/fop-core/src/main/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java#L178
          
      There is also another reference about this being an issue here:
          
      https://lists.apache.org/thread/ygc9kxy5y1k2gfcgfo7hn50kq0mzdq9t
          
      For our use case, this check is completely unnecessary since the fonts are never going to change anyway in a containerized environment.

      Attached is a patch for an opt-in <skip-last-modified-check /> configuration in the <fonts> section. If enabled, the last modified date will simply not be used. I also added test cases for the configuration itself and the that the FontInfoFinder actually does ignore the last modified date, if configured.

      Feel free to request any changes. I can also open a GitHub PR for this if you want.

      Attachments

        1. fontskiplastmodifiedcheck.diff
          24 kB
          Marius Thesing

        Activity

          People

            Unassigned Unassigned
            mus.svz@gmail.com Marius Thesing
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: