Repository navigation
Conversation
MessageCodeGenerator and stylesheets
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.
Claude's take on performance optimization.
Java changes (
MessageCodeGenerator.java)DOMSource, so Saxon redid the DOM conversion each time. The DOM parse itself, with its security settings, is unchanged; the converted tree is cached next to it. This was the biggest single gain.TransformerFactorywas created and the XSL recompiled for every phase of every version. Now one factory and a cache of compiled stylesheets are used, keyed by the XSL's path, so customtransformDirectorystylesheets still take priority.fieldName/itemNamechanges per file. TheutcTimestampPrecisioncheck also moved out of the per-field loop.Stylesheet changes
4.
Fields.xsl: to generate one field, the fix template walked every element of the dictionary, including all messages and components. It now goes straight tofields/field[@name=$fieldName], which removes a cost that grew with the square of the dictionary size.5.
Message.xsl, MessageSubclass.xsl, MessageFactory.xsl: field and component lookups by name, like/fix/fields/field[@name=$name], scanned the whole list every time. They now usexsl:keyindexes. The//component[@name=$myname]lookups use a key on all component elements, so they return exactly the same nodes as before.Custom stylesheets keep working because they receive the same document; only its internal form changed.