Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.9
-
None
-
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.