Skip to content

Refactor XML Parser & XML Generation#223

Merged
EmmasBox merged 3 commits into
Mainframe-Renewal-Project:devfrom
yinjie-z:feat/update-xml-generator-parser
Mar 20, 2026
Merged

Refactor XML Parser & XML Generation#223
EmmasBox merged 3 commits into
Mainframe-Renewal-Project:devfrom
yinjie-z:feat/update-xml-generator-parser

Conversation

@yinjie-z

@yinjie-z yinjie-z commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

💡 Issue Reference

Issue: #214

💻 What does this address?

This PR focuses on modernizing the XML Generation and Parser logic. The primary goals were to replace brittle conditional logic with efficient lookups and to standardize string handling across the codebase.

📟 Implementation Details

Logic Modernization: Refactored XMLGenerator to use std::unordered_map for administrative type and operation mappings, replacing long if/else chains. This improves maintainability and lookup performance.

Standardized String Handling: Updated both xml_generator.cpp and xml_parser.cpp to consistently use std::string. This eliminates manual memory management and improves safety during conversions.

Function Cleanup: Streamlined the core functions in XMLGenerator to be more modular and readable. Specifically:

  • Simplified the segment creation logic to automatically handle interleaved JSON keys.
  • Cleaned up the trait-to-XML mapping to reduce code duplication.

Added a checkout step to the Labeler workflow to prevent The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api in job log.

@github-actions github-actions Bot added the tests This tag is for pull requests and issues relating to unit tests or functional tests label Mar 18, 2026
@github-actions github-actions Bot added the build Related to packaging, compiling, and GitHub actions label Mar 18, 2026
@yinjie-z yinjie-z added the core Core API changes, such as changes to the C/C++ code or schema changes label Mar 18, 2026
@yinjie-z

Copy link
Copy Markdown
Collaborator Author

Before : Summary link

Benchmark Avg Time (ms) Memory Growth (KB)
Validation_Syntax_Error 0.0199 612.0000
IRRSMO_Generate_Add_User 0.9884 440.0000
IRRSMO00_Parse_Add_User_Result 0.9935 128.0000
IRRSEQ00_Generate_Extract_User 0.4413 172.0000
IRRSDL00_Generate_Extract_Keyring 0.5284 0.0000

After : Summary link

Benchmark Avg Time (ms) Memory Growth (KB)
Validation_Syntax_Error 0.0229 636.0000
IRRSMO00_Generate_Add_User 1.0587 728.0000
IRRSMO00_Parse_Add_User_Result 1.0615 0.0000
IRRSEQ00_Generate_Extract_User 0.5832 0.0000
IRRSDL00_Generate_Extract_Keyring 0.6959 0.0000

@EmmasBox EmmasBox left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@EmmasBox EmmasBox merged commit 5f81f07 into Mainframe-Renewal-Project:dev Mar 20, 2026
7 checks passed
@yinjie-z yinjie-z deleted the feat/update-xml-generator-parser branch March 23, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Related to packaging, compiling, and GitHub actions core Core API changes, such as changes to the C/C++ code or schema changes tests This tag is for pull requests and issues relating to unit tests or functional tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants