Repository navigation
Conversation
…wer metrics PptxViewerMetrics.load read the viewer ascent of each of a registered family's four slots through Font.createFont, opening each slot's source afresh. A family registered from one file repeats that file in all four slots, so it was parsed four times per deck. The ascent is now kept per FontBinarySource.description() for the slots of one load, the key the program read beside it already uses. The failure path and the deck's bytes are unchanged. Measured with a harness outside the build, logging quiet: the metrics read took Cousine 9.8 -> 2.3 ms and Gothic A1 26 -> 5.9 ms; a one-page deck in that family 51-54 -> 43-45 ms and 131 -> 111-112 ms. Every part of six decks is byte-identical before and after.
DemchaAV
marked this pull request as ready for review
November 26, 2026 01:22
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Before a slide is drawn, a PPTX export reads the viewer ascent of each registered family's four faces (
PptxViewerMetrics.load, throughFont.createFont). It read each slot's source afresh. A family registered from one file, whichFontFamilyDefinition.Builderrepeats in all four slots, was opened and parsed four times per deck. The program read beside it (PptxFontEmbedder.readPrograms) already skips a source whosedescription()it has seen.Measured before the change, with a counting source: 4 opens per
loadfor a one-file family;loadtook 9.8 ms of a ~52 ms one-page deck for Cousine (301 KB), and 26 ms of ~131 ms for Gothic A1 (2.2 MB).What changed
PptxViewerMetrics.loadkeeps the ascent it read perdescription()for the four slots of one call, and answers a repeated source from it. It uses the same key asreadPrograms, so the two reads agree on which slots share a program.description()is still asked inside the sametry, which now holds the lookup too. A refusal still ends the load at the first unreadable face, in slot order, and that face is the one named.Verification
PptxViewerMetricsTest(new, 4 tests):logback-benchmark.xml), base and changed classes alternating:load: Cousine 9.8 → 2.3 ms; Gothic A1 26 → 5.9 ms (median of 1600, two rounds)../mvnw -B -ntp test -pl :graph-compose-render-pptx -am: core 845, render-pdf 347, testing 5, render-pptx 211 tests, 0 failures;./mvnw -B -ntp test -f qa/pom.xml: 1927 tests, 0 failures.5f8649272(reactorclean verifyas CI runs it, the four JDK 17 knowledge checks, core javadoc, install, examples tests): GATE PASS — reactor 6286 tests, 0 failures; examples 93 tests includingCommittedAssetDriftTest, 0 failures.Lane: render-pptx backend internals; no layout, core or public API change. No example renders a PPTX with a registered family, so no committed preview is affected.